how to label the solution to a matrix in matlab
Show older comments
This is what I have...
%1.152T1 - 1.152T2 = -50974.255 sinx
%1.536T1 + 1.536T2 = 50974.255 cosx
a = [1.152 -1.152;
1.536 1.536 ];
x = 0:5:60;
b = [-50974.255*sin(x*(pi/180));
50974.255*cos(x*(pi/180))];
T = a\b;
Run (Result)
>> testproject
>> T
T =
1.0e+04 *
1.6593 1.4602 1.2499 1.0302 0.8026 0.5688 0.3308 0.0902 -0.1510 -0.3911 -0.6282 -0.8606 -1.0864
1.6593 1.8458 2.0183 2.1754 2.3159 2.4389 2.5432 2.6282 2.6932 2.7377 2.7614 2.7641 2.7457
I want to label the two rows as T1 and T2 and I want to label the the columns as degrees going from 0 to 60.
Answers (1)
Walter Roberson
on 7 May 2015
Use num2str() to produce a character array for the data. Use horzcat() to prefix it with
['T1 '; 'T2 ']
Display the resulting character array.
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!