Extracting Data to a workspace
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, guys, I would like some help.
The coding below is a m-script file that I run to obtain an 'A' solution.
I would like to retrive the data into one workspace.
The table is the format that I expect to retrieve every variable in the for loop. Is there any method to write to obtain the results like the table?
(The first row is to show how it is arrange and it is not displayed in the workspace)
close all; clear all; clc;
cnt = 0;%count
for X=0:5
for Y=0:5
cnt=cnt+1;
A(cnt,:)=X+Y;
end
end
0 件のコメント
採用された回答
Stephen23
2020 年 10 月 14 日
The MATLAB approach:
>> [X,Y] = meshgrid(0:3,0:2);
>> A = X+Y;
>> M = [X(:),Y(:),A(:)]
M =
0 0 0
0 1 1
0 2 2
1 0 1
1 1 2
1 2 3
2 0 2
2 1 3
2 2 4
3 0 3
3 1 4
3 2 5
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!