Sublot function is not working

24 ビュー (過去 30 日間)
Radvydas
Radvydas 2023 年 10 月 25 日
編集済み: Dyuman Joshi 2023 年 10 月 25 日
clear all
close all
load auksas.txt
figure (1)
subplot(3,1,1),plot(auksas(:,1),auksas(:,2),'r*'), grid
xlabel('Aukso kaina'), ylabel('Naftos kaina')
subplot(3,1,2),plot(auksas(:,1),auksas(:,3),'bo'), grid
xlabel('Aukso kaina'), ylabel('SP500 kaina')
subplot(3,1,3),plot(auksas(:,1),auksas(:,4),'k+'), grid
xlabel('Aukso kaina'), ylabel('Sidabro kaina')
I wrote this code ant I get the error message: "Execution of script subplot as a function is not supported:
/MATLAB Drive/subplot.m"
How should I fix this issue?
Thanks in advance!

回答 (1 件)

Les Beckham
Les Beckham 2023 年 10 月 25 日
Rename "/MATLAB Drive/subplot.m" to some other name.
If you issue this command at the command prompt you should only see one output (as shown below):
which -all subplot
/MATLAB/toolbox/matlab/graph2d/subplot.m
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 10 月 25 日
編集済み: Dyuman Joshi 2023 年 10 月 25 日
@Radvydas, after renaming the scripts to other names as @Les has mentioned above, you should run this command -
clear subplot
Also, you should keep in mind to not use built-in function names as variables or script names.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by