Info
この質問は閉じられています。 編集または回答するには再度開いてください。
help with this basic matlab code..
1 回表示 (過去 30 日間)
古いコメントを表示
Here is a code I wrote,
I want the each file to be cut off
I got right up to cut_2 bit.
But problem comes in Mean_process_cut_cut_image_posi = rot90(cut_2,3);
I want to rotatte the image and want to call it as Mean_process_cut_cut_image_posi
But when I run, in a workspace it only shows
Mean_process_image_pos1
....
Mean_process_image_pos5
and
Mean_process_cut_cut_image_posi
whereas I want to have
Mean_process_cut_cut_image_pos1
Mean_process_cut_cut_image_pos2
Mean_process_cut_cut_image_pos3
I think this should be easy bit... but I am stuck at this for an hour..
Here is my code.
files = dir('*.mat');
for i=1:5
load((['Mean_process_image_pos',num2str(i),'.mat']));
%load(files(i).name);
cut_1 = rot90(Mean_process_image_pos1, 3);
x = 193; %10mm
y = 768 -x;
cut_2 = cut_1(:,x:y);
Mean_process_cut_cut_image_posi = rot90(cut_2,3);
end
stacked_cut_image= [ Mean_process_cut_cut_image_pos5;Mean_process_cut_image_pos4;Mean_process_cut_image_pos3;Mean_process_cut_image_pos2;Mean_process_cut_image_pos1];
0 件のコメント
回答 (1 件)
Iain
2014 年 10 月 8 日
The answer you're looking for is actually really really really horrible:
Mean_process_cut_cut_image_posi = rot90(cut_2,3);
Should be:
eval(['Mean_process_cut_cut_image_pos' num2str(i) ' = rot90(cut_2,3);']);
But that is awful matlab. You should replace it with:
stacked_cut_image(i,:) = rot90(cut_2,3);
1 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!