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

2 ビュー (過去 30 日間)
Sook Yee Lim
Sook Yee Lim 2017 年 5 月 19 日
コメント済み: Adam 2017 年 5 月 19 日
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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by