Answered
dir-command: import only files that have datenum between two dates
I don't know that cellfun is going to work on the dir results because they are an array of structures. You should be able to sol...

7 years ago | 0

Answered
Storing multiple different values from an equation in a for loop
Because you are running multiple two for loops, you likely need to have two dimensional indexing. V(k,m) = ... This should giv...

7 years ago | 0

| accepted

Answered
How can fix index exceeds matrix error
Your first error occurs with teta{i} = acosd(br/r2{i}); because r2 has one less element than the max values of i. I would sugges...

7 years ago | 1

| accepted

Answered
For loop inside structure
fields = fieldnames(level3); for k=1:10 x = [x0. * vx]; end If I understand this correctly you're trying to capture the ...

7 years ago | 1

Answered
1X1500 cell array to matrix
You can try using cell2mat(), but I'm not intimately familiar with it enough to know if it will work with arrays inside each cel...

7 years ago | 0

Question


How to output function results over split columns
I have a loop which contains a function that produces results to a different sheet of a matrix. I would like to insert an additi...

7 years ago | 1 answer | 0

1

answer

Answered
dividing data into sub-data
A = [-1 1 1 1; -1 -1 -1 1; -1 1 -1 -1; -1 1 1 -1; -1 1 1 -1]; B = A(:,1:2); C = A(:,3:4);

7 years ago | 0

Answered
how to enter struct into new struct ?
I'm going to assume that data(i) = data1 does not work, because you're trying to put an entire array into a single element of a ...

7 years ago | 0

Answered
I am currently writing a code to plot the coordinates of a five digit airfoil, but I keep getting the error : "index exceeds matrix dimensions". What do I do ?
The issue is that yt only contains one value. I suspect you may have forgotten an index on the following line: yt=5*T*(t0+t1+t2...

7 years ago | 0

| accepted

Answered
How do I import different *.txt file into matlab?
To the best of my knowledge the 'import' commands are just not intended to handle more than one file at a time, so your best bet...

7 years ago | 0

| accepted

Question


Concatenating data from structure array for plotting
I have a structure array with several levels of depth that I am trying to extract a specific set of data from in order to plot i...

7 years ago | 2 answers | 0

2

answers

Answered
Reading Columns with dlmread
I advise reading the entire file with csvread(), and then extracting the column from the data within matlab. It is generally ver...

7 years ago | 0

Answered
Retrieve data from several structures and folders
If I'm understanding this correctly, you're looking to dynamically change the variable you're using each time you go through the...

7 years ago | 0

Answered
Find slope across columns of cell
How are you organizing the data into ordered pairs? I'm assuming that by 'numerical data' you mean you have cells that contain i...

7 years ago | 0

| accepted

Answered
adding an additional variable to a bracket
I'm a little confused at what the problem is exactly. Would you be willing to explain a little bit more about what exactly you h...

7 years ago | 2

| accepted

Answered
problem in matrix dimension
I think that your issue is with K*Y. As best I can tell, K is 3x3, while Y is 2x2, so it is not possible to do matrix multiplica...

7 years ago | 0

| accepted

Answered
Problem with my code- trying to iterate through a matrix
Why are you setting both x0 and y0 equal to the ordered pair of your 'origin'? [x0]=rand_values(index,:); [y0]=rand_va...

7 years ago | 0

Answered
Create a zero matrix and update cells based on other column values
I'm going to take a stab at what you're looking for here, let me know if I need to adjust something. I'm going to begin with th...

7 years ago | 0

Answered
how do I clear excel content of an old file before saving the news results to it?
One option for doing this is to specify your maximum range all the time, rather than adjusting to a specific range. Anything bey...

7 years ago | 2

Answered
How to create a distance matrix in matlab
What do you mean by 'picking order'? I have no experience actually doing this, but my first thought would be to create a matrix...

7 years ago | 1

Answered
Sortrows alternative / matrix sorting
I know it may not be the fastest method, but what about using a loop to sort each element. Because you have 'time' and a piece o...

7 years ago | 0

Answered
Need help reading from arrays and finding corresponding value
When combining multiple if conditions you want to use & (and) and | (or). For your purpose though you can just find the minimum...

7 years ago | 0

Answered
How to loop inputs into a structure
First guess at your problem is that the initial for loop where you define all of the inputs doesn't save the results in an index...

7 years ago | 0

| accepted

Answered
How to import multiple data from .csv and analyse them?
files = dir('Your file directory'); % I suggest adding a *.csv to this to only get the .csv files. for i = 1:length(files) ...

7 years ago | 2

| accepted

Answered
Extract and average from matrix
The lowest difficulty way of doing this, that I can think of, is to use a for loop. for i = 1:length(data)/7; ave(i) = mea...

7 years ago | 0

| accepted

Answered
How to select rows with a particular value form one text file and write desired rows in new file?
I'm assuming the file only has numeric data. data = dlmread('yourfilename.txt'); datan = data(data(:,3)<0.4,:); dlmwrite('you...

7 years ago | 1

Answered
How to create a for loop to calc average of datas in a STRUCTURE?
I apologize, I don't quite understand what you're looking for as a final product. Would you mind restating it, and maybe having ...

7 years ago | 0

Answered
How to stop loop from giving my matrix a certain value?
I suspect the issue is that you are not indexing Matrix during your elseif condition. If you want to run the loop you should set...

7 years ago | 0

Answered
Help with looping through columns from .csv-file and writing data to .xlsx-file
It is the presence of the internal letter loop that is causing your problem. You are writing all five cells for each time you ru...

7 years ago | 1

| accepted

Answered
How to plug in values from for loop to a single formula?
I'm assuming you want the result for each set of inputs. Personally, I think the easiest way to do this is by putting the equati...

7 years ago | 0

| accepted

Load more