Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

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

más de 7 años hace | 0

Respondida
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

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 2

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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))...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 0

Respondida
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));

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Cargar más