How do I make a series of variables A1, A2, A3, ... A10?

1 view (last 30 days)
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

Accepted Answer

Image Analyst
Image Analyst on 17 Jan 2013
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');

More Answers (1)

Walter Roberson
Walter Roberson on 5 Feb 2013

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!