Académique Documents
Professionnel Documents
Culture Documents
File Exchange
Answ ers
New sgroup
Link Exchange
Blogs
Trendy
Cody
Contest
MathWorks.com
Example: for i=1:n X=DATA1(i,1); Y=DATA2{1,i}; Z=X-Y; end what I want is that it saves the data to Z, summing them, so, for i=1 , Z=[1 2 3 4 5], for i=2 Z becomes Z=[1 2 3 4 5 6 7] etc. so i need to do something with Z but dont know what. currently it only shows the result of the last i.
2 Comments
Show all comments Image Analyst on 14 Dec 2012 Link
Save Cancel
Do you really have X as a numerical array (double, etc.) and Y as a cell array???
Hello kity on 14 Dec 2012 Link
Save Cancel
yes x= column full of values (nummerical array) and Y cells , with each cell with diff lengths
0 votes
Flag
A flag is a request to an editor to review and potentially close or delete content on MATLAB Answers. Include the reason for your flag below.
Not appropriate for MATLAB Answ ers More
Inappropriate flags an invalid question. These questions lack any of the following: Detail for ensuring a proper response Sufficient work or thought on the part of the requester (do-it-for-me request) Usefulness to the community
Spam More
Unclear flags a question requiring more information. These questions are illogical, lack detail, or may not be a question. Unclear questions can be reopened within 10 days of closure. Thereafter, unclear questions become permanently deleted.
Provide additional information about your flag below Your message w ill be publicly visible.
www.mathworks.in/matlabcentral/answers/56588-how-to-save-for-loop
1/3
4/11/13
Save Cancel
Tags
cell2mat
Products
MATLAB
1 Answer
Answ er by Pedro Villena on 14 Dec 2012 Edited by Pedro Villena on 14 Dec 2012 Accepted answ er
1 Comment
Show all comments Hello kity on 14 Dec 2012 Link
Save Cancel
the first one works if both X and Y are matrix ( ()) but if Y is cell array {} then it gives trouble. Somehow I need to convert Y to matrix then put it in the equation. I look into the second tip thank you
0 votes
Flag Include the reason for your flag below : Your message w ill be publicly visible.
Direct link to this answer: http://www.mathworks.in/matlabcentral/answers/56588#answer_68515 Create a community profile to answer or comment on this question.
Contact us
www.mathworks.in/matlabcentral/answers/56588-how-to-save-for-loop
2/3
4/11/13
1994-2013 The MathWorks, Inc.
New Products
Documentation
Training
www.mathworks.in/matlabcentral/answers/56588-how-to-save-for-loop
3/3