フィルターのクリア

help with label

1 回表示 (過去 30 日間)
peri
peri 2011 年 10 月 19 日
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 件のコメント
peri
peri 2011 年 10 月 19 日
heres the rest of the code:
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’
Daniel Shub
Daniel Shub 2011 年 10 月 19 日
What is the error message?

サインインしてコメントする。

採用された回答

Daniel Shub
Daniel Shub 2011 年 10 月 19 日
I am guessing you have a variable somewhere called xlabel. What do you get with
which xlabel -all
it should be something like .../toolbox/matlab/graph2d/xlabel.m. If you get "xlabel is a variable", a drastically different path, or multiple paths, that is your problem.

その他の回答 (2 件)

Wayne King
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
Wayne King 2011 年 10 月 19 日
copy and paste the code I've entered. I've corrected your single quotes.
peri
peri 2011 年 10 月 20 日
ive changed single quotes myself, but still get the message

サインインしてコメントする。


Daniel Shub
Daniel Shub 2011 年 10 月 19 日
What type of single quotes are you using? It could be the code formating in my browser, but your quotes look funky.

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by