yes yuk99 is rite
accessing array in maltab is very easy.
just use A(1) for first node and if u want to access all the elements in a loop then use this
for simple for loop:
for i=1:10
x = A(i);
end
Main Topics
Browse All TopicsHi guys,
How do you access and print array node in matlab
for example i wan to access array A = [1, 2, 3, 4, 5, 6, 7, 8];
I want to acceess first node value of array A
Help
This question is in progress.
Our experts are working on an answer right now.
Sign up for immediate access to the solution once it becomes available.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
It's always recommended to avoid loops in Matlab whenever possible. Loops are much much slower than vectorized expressions. For example, the above loop from Romasa can be substituted single expression
x=A(1:10);
Bracket both into tic ... toc to see time difference.
Although I must say that sometimes loops are unavoidable or vectorization may requires more complex algorithm logic.
Business Accounts
Answer for Membership
by: yuk99Posted on 2009-05-09 at 12:01:58ID: 24345185
You can get the first value by statement A(1). You can assign it to another variable by b=A(1);
ompany/new sletters/d igest/sept 01/ matrix. html
Use semicolumn (;) at the end of statement if you don't want matlab to display the output.
To access the last value you can use A(end). To access any sequence in any order if you use vector of indices, for example A([5 1 3]) will return vector [5 1 3].
For more information see this link
http://www.mathworks.com/c