Info

This question is closed. Reopen it to edit or answer.

i am executing a piece of code given below in which i am getting the error"Unexpected MATLAB expression" help me to solve it

1 view (last 30 days)
rc = D S
0.0012 0.0001
0.0105 0.0010
0.0705 0.0070
0.2373 0.0340
0.6196 0.1123
1.5142 0.3193
2.8189 0.7740
4.0687 1.4638

Answers (1)

per isakson
per isakson on 4 Mar 2015
Edited: per isakson on 4 Mar 2015
What is your intent? This doesn't honor Matlab syntax rules.
Minimal changes are needed to create a cell array
rc = { 'D' 'S'
0.0012 0.0001
0.0105 0.0010
0.0705 0.0070
0.2373 0.0340
0.6196 0.1123
1.5142 0.3193
2.8189 0.7740
4.0687 1.4638 };
and with a little more editing one can create a table
val = [ 0.0012 0.0001
0.0105 0.0010
0.0705 0.0070
0.2373 0.0340
0.6196 0.1123
1.5142 0.3193
2.8189 0.7740
4.0687 1.4638 ];
D = val(:,1);
S = val(:,2);
rc = table( D, S )
which outputs
rc =
D S
______ ______
0.0012 0.0001
0.0105 0.001
0.0705 0.007
0.2373 0.034
0.6196 0.1123
1.5142 0.3193
2.8189 0.774
4.0687 1.4638

This question is closed.

Community Treasure Hunt

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

Start Hunting!