Answered
How can I split up several numbers in one cell from an excel file?
[~,~,data] = xlsread('myexcel.xlsx',range); data = cellfun(@(x) str2num(x),data); This is a first crack at the code. I'm not a...

7 years ago | 0

Answered
How to plot data from a text file with variable delimeters.
Others may have a better solution, but because of the varying delimiters I think you may have a better time with just loading th...

7 years ago | 0

Answered
Find all instances of a condition in x , replace corresponding y values with ymax (of subset or a give value) via for loop..data attached
Instead of looping through all values of h_new, you might try looping through all unique values of x. uniques = unique(x); hco...

7 years ago | 0

Answered
Read multiple files and store fitting parameters & graphs
function [results] = test(A,B,C,D,E,F,G,H,time) numfiles = 2; mydata = cell(1, numfiles); for k = 1:numfiles myfilenam...

7 years ago | 0

Answered
Simpler way of getting single column from each row?
Without having access to your data I can't test this, but my first thought is to do basically what you mentioned last. waveValu...

7 years ago | 0

Answered
Splitting up large amount of data into smaller tables based on one coloumn
Hmm, I think I kind of understand what you are trying to do. Let me know if this works. mark = 1; cll = 1; for i = 2:size(x,1...

7 years ago | 0

Answered
Unstack long XY data sets into individual tests over columns by length
Try: datatest = reshape(data,[25,3910]);

7 years ago | 0

Answered
inserting into certain locations in array
F = A; for i = 1:I F = [F(1:C*i+length(B)*(i-1)),B,F(C*i+length(B)*(i-1)+1:end)]; end

7 years ago | 0

| accepted

Answered
how to write this equation in Matlab?? please help
sigma = (I/eta).*sum(sqrt(ln((Imax(range)+Imin(range))./(Imax(range)-Imin(range)))); Something like this. Your 'range' is going...

7 years ago | 0

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
You're getting the error because you are using 'beta(a,b)' inside your loop, but neither a or b are positive integers or logic s...

7 years ago | 1

| accepted

Answered
How to compare values in two arrays and find when the index of one array exceeds the index of another
i = 1; j = 1; k = 1; while k <= size(A); if A(i) >= B(j); C(k) = 0; k = k+1; j = j+1; el...

7 years ago | 0

| accepted

Answered
Excel filename from cell
xlswrite(mycell{1},data);

7 years ago | 0

Answered
Using Excel files in function
This is a quick first cut, so you will likely need to do some fine tuning of your own. I am assuming that your city distance dat...

7 years ago | 2

| accepted

Answered
Removing zeros in excel
Guillaume and Walter will probably have much better methods for doing this, but here is my first thought. [num,txt,data] = xlsr...

7 years ago | 0

Answered
Multiple conditional statements and a for loop.
You can combine multiple conditions using & (and) and | (or) (&& and || are also things). Using this method I think it's worth c...

7 years ago | 0

| accepted

Answered
How do I import multiple text files and automatically add them into a single cell array? Maybe 3D?
In looking over your code I don't actually see any dynamic naming occuring. Dynamic naming is manually naming variables with dif...

7 years ago | 1

| accepted

Answered
Making a plot to find out when, during a 24 hour period, two rows in excel has the same value.
Do you specifically need to plot the results? Why not just use logic indexing? t = data(:,ismember(data(:,2:3,1),data(:,2:3,2))...

7 years ago | 0

Answered
I need help to correct this code. How do I get this error corected (Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix.)?
I believe the error is in using matrix multiplication, versus element multiplication. You have: detPhotonsF = F + randn(noOfRun...

7 years ago | 0

| accepted

Answered
How do i make a function with the question below?
func2str is a command which converts a function class variable (i.e. your f variable) into a string class variable. A class is b...

7 years ago | 0

| accepted

Answered
Check each element in matrix is less than value
i would like to check if each element By 'check each element' do you actually need to go through each element in a loop, or wo...

7 years ago | 0

Answered
How to open files in different folders for data processing?
Take a look at this. https://www.mathworks.com/matlabcentral/fileexchange/172-findfiles It is possible to look through directo...

7 years ago | 1

Answered
how i can delete useless data from matrix
Here is something to try. Probably not the most efficient, but it should do what you're asking. vals = unique(data(:,8)); data...

7 years ago | 0

Answered
Extract the index and find the value in other array that have the same extracted index?
You shouldn't actually need a for loop to do this, just some logic indexing. goal = x2(ismember(t2,t1));

7 years ago | 0

| accepted

Answered
Pass values to outside of loop after each iteration
You cannot 'pass' the values out of the loop, but instead you should store them in an indexed variable. Then, after the loop has...

7 years ago | 0

Answered
How can i operate on every newly created vector in a for loop?
Ok, I think maybe all you need to do is add a second internal loop to loop through all the cells of the previous iteration. for...

7 years ago | 0

Answered
limiting columns of a matrix
The reason you're getting that error is because you cannot call the index of an empty array. If limit1 is (1x0) double and you a...

7 years ago | 0

| accepted

Answered
How to check multiple values of one variable in if statement
You should just be able to index your if condition. if col(1:3) == [1 2 3] // do something end

7 years ago | 1

| accepted

Answered
Matching Time from 2 files/arrays
Ok, I think I found a more workable solution. First I would convert your cells to datetime, because I prefer working in regular ...

7 years ago | 1

| accepted

Answered
when ploting the left y axis always be the bule I can not change the color
When using any of the plot commands it is possible to add a string to format the plotted line. plot(x,y,format); % Where format...

7 years ago | 0

| accepted

Answered
Update figure after each loop
I suspect that you are having a challenge because you activate 'hold on' right after myfunc3(), but you don't deactivate it. Thi...

7 years ago | 0

Load more