Info

此问题已关闭。 请重新打开它进行编辑或回答。

transforming cells to some matrics in loops

1 次查看(过去 30 天)
som
som 2012-2-1
关闭: MATLAB Answer Bot 2021-8-20
Hi all
I've written a program like below. it has a cellular variable named " tsd_total {n,ss} (ii,rr) ".
as you see this variable is inside some loops. I want to define a new variable like " obj_func " which is located after the third loop and its role is to transform " tsd_total {n,ss} (ii,rr) " into matrix form. I want also define a counter for " obj_func " which changes its value for each ' t ' as well as 'y'.
How can I do this? where should be the exact place of " obj_func " ?
clc; clear;
T=3;
Y=10;
M=Y;
n=1;
y=1;
while n<100
for t=T:-1:1
for ss=1:ns
for ii=1:M
for rr=1:nr
tsd_total{n,ss}(ii,rr)=tsd{t,ss}(ii,rr);
end
end
end
n=n+1;
obj_func{y}(t)=cell2mat(tsd_total(t,1:ns)); % <== REFFERS TO MY QUESTION.
end
y=y+1;
end
Can you guide me clearly.
thanks,

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by