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

2 次查看(过去 30 天)
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 个评论
Adam
Adam 2017-5-19
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?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by