Question

In MATLAB, I have a 1xn cell. How can I seperate this cell into n number...

In MATLAB, I have a 1xn cell. How can I seperate this cell into n number of strings?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Cell array are similar to simple array, but the important difference is each elemet of cell can be of different data-type.

For example,

n = 4;

mycellarray = cell(1,n);
mycellarray = {1,'my name', [1,2,3], [1,2,3;4,5,6] };

mycellarray holds integer, array, matrix, string.

Matlab code to convert cell array into strings:

C = {'a', 9, 'b', 10,[1,2,3],[1,2,3;4,5,6]} % Initialise the cellarray
All_strings = cellfun(@num2str,C,'UniformOutput',0) %convert each cell into string

Add a comment
Know the answer?
Add Answer to:
In MATLAB, I have a 1xn cell. How can I seperate this cell into n number...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT