How to store vectors in a 3d matrix using a for loop

2 views (last 30 days)
I imported the data from the file and I want to store the Ra and Nu values for each unique value of A in a 3d matrix using for loop.This is what I have so far:-
if true
% code
end% Import data
Experimental_data = importdata('experimental_data_1.csv');
% Extract details
text_data=Experimental_data.textdata;
% Use for loop to restructure data
for i=1:length(A_unique);
Ra=?
Nu=?
A_unique(:,:,i)=[Ra,Nu];
end
Pls guide me on how to write the for loop?
num_data = Experimental_data.data;
% Extract from columns
A=num_data(:,1);
Ra=num_data(:,2);
Nu=num_data(:,3);
% Find unique values of A
A_unique=unique(A);
  1 Comment
Adam
Adam on 19 May 2017
You shouldn't need a loop. What does your data look like after you have imported it? Are A, Ra and Nu three separate variables?

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!