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

采纳的回答

Image Analyst
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');

更多回答(1 个)

Walter Roberson
Walter Roberson 2013-2-5

类别

Help CenterFile 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!

Translated by