フィルターのクリア

How can I make .xlxs file for the following code?

1 回表示 (過去 30 日間)
Mohammad Wasiq
Mohammad Wasiq 2022 年 9 月 8 日
コメント済み: Mohammad Wasiq 2022 年 9 月 15 日
for i = 180:5:200;
for j = 0.00160:0.00001:0.00170;
for k = 0.1:0.01:1;
alp = (j)*(i)*(i)/k;
display(i); display(j); display(k);
display(alp');
end
end
end

回答 (1 件)

Pulkit
Pulkit 2022 年 9 月 12 日
It is my understanding that you want to store result variable 'alp' in Excel file. This can be done by taking a counter variable 'ctr' for storing memory address and storing alp as an array(or matrix). Then exporting 'alp' to .xlxs file using 'writematrix' command.
The following can be achieved as:
ctr=1;
for i = 180:5:200;
for j = 0.00160:0.00001:0.00170;
for k = 0.1:0.01:1;
alp(ctr) = (j)*(i)*(i)/k;
display(i); display(j); display(k);
%display(alp');
ctr=ctr+1;
end
end
end
File_Name = 'File.xlsx';
writematrix(alp',File_Name,'Sheet',1);
Please refer to the following write matrix documentation for more information on how to operate ‘writematrix’ to export matrix into different file format.
  1 件のコメント
Mohammad Wasiq
Mohammad Wasiq 2022 年 9 月 15 日
Thasnks for the answer I want store the result of the i j k and the alp in the xlxs file in a tabular for.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by