help with label
显示 更早的评论
hello, i have a trouble with using labels, xlabel and ylabel when plotting a graph.
i get this fellowing message: Error in ==> Untitled6 at 6 xlabel('t-verdi')
3 个评论
Wayne King
2011-10-19
please provide more of the code. There's nothing per se about xlabel('t-verdi') that should throw an error
peri
2011-10-19
Daniel Shub
2011-10-19
What is the error message?
采纳的回答
更多回答(2 个)
Wayne King
2011-10-19
Have you copied in pasted your code from some Windows application where ' is not the single quote that MATLAB expects?
t = 0 : 0.1 : 4;
y = 1 + exp( - 0.05 * t.^2);
plot(t, y)
axis( [ 0 4 0 3 ] )
xlabel('t-verdi')
ylabel('y-verdi' )
title('Utvikling av . . . ' )
text( 2, 2.5, 'Grafen laget 12.12.01')
gtext('Grafen er laget ved MATLAB');
If you copy your code above into the MATLAB editor, you'll see that the single quotes do not appear properly. They will appear as read apostrophes and the string is not correct for MATLAB.
2 个评论
Wayne King
2011-10-19
copy and paste the code I've entered. I've corrected your single quotes.
peri
2011-10-20
Daniel Shub
2011-10-19
0 个投票
What type of single quotes are you using? It could be the code formating in my browser, but your quotes look funky.
类别
在 帮助中心 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!