h_MeanCostPlot=plot(MeanCost,'k:','LineWidth',1.5,'YDataSource','MeanCost');
im getting error while using this command in m-file.
is the syntax correct?

2 件のコメント

Wayne King
Wayne King 2012 年 2 月 2 日
Please show the error message you are getting
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
Error using ==> plot
Invalid line property: 'YDataSource'.

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

 採用された回答

Wayne King
Wayne King 2012 年 2 月 2 日

0 投票

Not sure why that is causing you a problem, (maybe a version problem), but try
h_MeanCostPlot=plot(MeanCost,'k:','LineWidth',1.5);
You should not need 'YDataSource' here unless you want to refreshdata()?
Does this work for you?
x = randn(100,1);
h = plot(x,'k:');
set(h,'YDataSource','x');
What version of MATLAB are you using?

11 件のコメント

Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
version 6.5
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
>> set(h,'YDataSource','x')
??? Error using ==> set
Invalid line property: 'YDataSource'.
this error is comming
Wayne King
Wayne King 2012 年 2 月 2 日
I'm pretty sure you don't have the ability to set that property in version 6.5 (that is quite old)
can't you just use:
plot(x,'k:','linewidth',1.5);
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
yes i need refreshdata
refreshdata(h_MinCostPlot);
then what should i do?
i have with me matlab 9, but is there any way to solve by nt installing matlab 9?
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
this version im using:
MATLAB Version 6.5.0.180913a (R13)
MATLAB License Number: 0
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 2)
Java VM Version: Java 1.3.1_01 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
Wayne King
Wayne King 2012 年 2 月 2 日
You mean R2009a or R2009b when you say MATLAB 9? There is no MATLAB 9 at the moment.
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
2009a
Wayne King
Wayne King 2012 年 2 月 2 日
refreshdata() is available in R2009a
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
is the thing possible if i download some function and save these in toolbox or in some other folder.so that the property will be installed
Krishnendu Mukherjee
Krishnendu Mukherjee 2012 年 2 月 2 日
if any ready file available only and only then i can installed that property.i myself cant make that function
Walter Roberson
Walter Roberson 2012 年 2 月 2 日
No, there is no download or toolbox that will add that property to MATLAB 6.5

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

その他の回答 (1 件)

Massa Tolba
Massa Tolba 2021 年 2 月 18 日

0 投票

Error in Q1 (line 9)
plot(i,A)
What should i do with this error

カテゴリ

ヘルプ センター および File ExchangeDownloads についてさらに検索

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by