How do I make a series of variables A1, A2, A3, ... A10?
3 次查看(过去 30 天)
显示 更早的评论
I'm trying to use mphinterp command: [u]=mphinterp(model,{'u'},'coord',Point','dataset','dset3') which gives me the eigenvector of a specific 'Point' (it is a 31*1 matrix in this example).
Now I have 24 points which i need their eigenvectors. Here is the command I wrote for it:
for i=1:24
Point=StatorCore(i,:); %StatorCore(i,:)=coordinates of the (ith) point
[u]=mphinterp(model,{'u'},'coord',Point','dataset','dset3');
end
The problem is that only the value of the last point (24) is saved in the work place and the rest will be replaced by the next eigenvector.
Can you tell me how i can define a series of variables like: u1,u2,u3,..,u24 because later i need to recall these eigenvector again.
thanks
0 个评论
采纳的回答
Image Analyst
2013-1-17
Define an array before the loop to capture all the various u vectors you get:
allUs = zeros(24, 31);
Then after you get one u in your loop, you can insert it into you allUs array:
allUs(k, :) = u;
Of course, you can just go directly into allUs without using the intermediate u variable if you want:
allUs(k, :) = mphinterp(model,{'u'},'coord',Point','dataset','dset3');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!