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

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

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

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

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

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

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

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

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

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

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

5 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

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

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

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

5 years ago | 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

6 years ago | 2

| accepted

Load more