Answered
Results of a while loop wont store in array
You need to index your result within the loop. x=[10:100]; a=10; b=100; c=0; resultsvector=[]; count = 0; %%%%%%%%%%%%%% ...

7 years ago | 0

| accepted

Answered
plotting in a loop with a function
You need to index z with each loop. count = 0; for x = 1:0.01:1.5; count = count + 1; z(count) = g(x,rpf); end plo...

7 years ago | 0

| accepted

Answered
Only the value corresponding to the last loop of a for loop being saved in the output array
You're getting the error because OCV(k) is a single element, and I suspect that Volt(A) is not. For the problem of only getti...

7 years ago | 1

Answered
Please could someone explain the basics of how MATLAB updates codes in a script?
Did you delete and repost this question? I swear I saw it earlier today. A couple of things about your code. 1) It doesn't l...

7 years ago | 1

| accepted

Answered
How can i loop a matrix without knowing is size?
So, you have two matrices, one outside the loop, and one inside? Which one are you not sure about the size of? If it is the out...

7 years ago | 0

| accepted

Answered
refrencing elements kindly explain each one
1) The first and second statements are really just the same thing, which is defining contents of matrices A and b. We know they ...

7 years ago | 0

| accepted

Answered
How to perform for-loop over sequential arrays?
It is generally always a bad idea to label variables as x1, x2, etc. because it means you have intentions of creating multiple v...

7 years ago | 0

Answered
saving 3 dimensional single data in an Excel file
xlswrite is only able to write data in a 2D format because it can only write to one sheet at a time. In order to write your 3D d...

7 years ago | 1

| accepted

Answered
How do I plot multiple, disparate lines onto one graph showing changes between 2 conditions?
I would suggest a quick loop through each of your subjects. You can keep multiple lines on a single plot by using the hold comma...

7 years ago | 0

| accepted

Answered
Find the min for each plane of a multidimensional array
A = randi(100,3,3,3); % Sample input [m,r] = min(A,[],1); % Locate minimum value for all rows [m,c] = min(m,[],2); % Locate ...

7 years ago | 0

Answered
delete rows from matrix if some of its elements equal all elements in another rows another different dimension matrix?
Sorry I couldn't come up with any way of doing it without a for loop. Others might know a better way of performing this, but her...

7 years ago | 1

| accepted

Answered
Importing IQ samples into the matlab
I'm assuming that '.biniq' is readable as an ascii file. If that is true then here are some options for loading the data: texts...

7 years ago | 0

Answered
combine data according to values in another vector in matlab
I know others can probably do better than I can at this, but here goes. data = [t; vals]; tims = uniques(t); for i = 1:length...

7 years ago | 0

| accepted

Answered
How to plot streamlines in matlab ???
Try using the quiver function. It's not perfect streamlines, but it should give you an idea of what the velocity field looks lik...

7 years ago | 0

Answered
How do I declare E=[1,-7,3,-9,5]
You can define each element of an array individually if you would like. Defining E should be pretty much exactly as it is listed...

7 years ago | 0

| accepted

Answered
nested cell arrays from tables
Without having seen your data I don't know that I will be able to come up with something perfect, but hopefully this will give y...

7 years ago | 0

Answered
how to find average signal from different excel sheets?
You can load and save the data with a for loop and then average afterwards. Alternatively, if you really want you can maintain a...

7 years ago | 0

| accepted

Answered
While Loop Keep running non stop !!
Ok, I think I got something working. The while loop was a fine choice, it was more a matter of indexing and changing things toge...

7 years ago | 1

| accepted

Answered
How to pick an Excel file using "import data" within code?
uigetfile

7 years ago | 0

| accepted

Answered
Matlab OR | operator not working
To the best of my knowledge the or operator doesn't work quite like that. You need to set separate conditions on each side of th...

7 years ago | 0

| accepted

Answered
Time-series data
The 'simplest' way to do a series of mean values is to use a for loop with the mean function. nmean = 50; % Number of values yo...

7 years ago | 0

| accepted

Answered
combining (concat) matrix in loop to get desired output plot
I suspect the issue you're having is because you're using the same C4 without attaching it to Z each time in the loop. This mean...

7 years ago | 0

Answered
How to modify this could so it can read from different files groups?
Add a second loop. Instead of just going through all files in a single loop, have an outer loop that looks for the number of gro...

7 years ago | 1

| accepted

Answered
Looping the data along with deliminaters (please find the code below)
You were on the right track with your loop that you had already, the biggest thing would be to add an index. i = 0; ...

7 years ago | 0

Answered
Data Analysis advance filtering
You can do this with logic indexing. data = ... % Your main data block conditions = data(:,1)>0.1 & data(:,2)>3 & data(:,3)<1;...

7 years ago | 0

Answered
How to modify this code to make it import values from a file?
Importing and reading the data into matlab is fairly simple, and you can take your pick of text readers. It sounds like dlmread ...

7 years ago | 1

| accepted

Answered
How can I display a value of a vector for a specific value?
This can be done with logic indexing. w2 = w(p==0);

7 years ago | 0

Answered
i have to read files in specific folder
You need to specify the path that you gathered with 'test_image', otherwise the dir command is just going to search the current ...

7 years ago | 0

Answered
Plotting data within a loop
I'm not sure if I understand exactly what you're trying to do, but here goes. nums = unique(tr(:,h)); for i = 1:length(nums) ...

7 years ago | 0

| accepted

Answered
How to loop multiple images in a subplot?
There are some small adjustments to be made for this to work. Also, I'm not sure what you want to plot your 'c' variables agains...

7 years ago | 1

| accepted

Load more