online Matlab giving suddenly started giving error

4 ビュー (過去 30 日間)
abdul rehman
abdul rehman 2021 年 6 月 30 日
回答済み: Steven Lord 2021 年 6 月 30 日
the code was working fine, suddenly it sarted giving error in online version, still working ok on desktop.
code:
Rep_veh = rand((randi(20)),1); % random vehicle 20 or x experience scor between 0 to 1
Spec_veh = (1 + rand(randi(3),1))/2; % random vehicle x experience scor between 0 to 1
Wanted1 = Rep_veh(Rep_veh > .5);
m1=mean(Spec_veh);
m2=mean(Wanted1);
mean(m1+m2)/2
error:
Array indices must be positive integers or logical values.
Error in two (line 9)
m1=mean(Spec_veh);
9 m1=mean(Spec_veh);

採用された回答

Steven Lord
Steven Lord 2021 年 6 月 30 日
Delete the variable you've created named mean that is preventing MATLAB Online from calling the mean function. You should also modify your code so it doesn't create a variable named mean when you execute it.

その他の回答 (1 件)

Prakhar Rai
Prakhar Rai 2021 年 6 月 30 日
It is working fine for me in matlab online.
Please refresh your matlab onine and try again.
  2 件のコメント
abdul rehman
abdul rehman 2021 年 6 月 30 日
how to refresh online matlalb ? i have tried saveral time opening and closing
Prakhar Rai
Prakhar Rai 2021 年 6 月 30 日
You could use this command:
!matlab &
exit
This will give a prompt to restart matlab online.
Just click and it should restart.

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by