how do i get function of "function chenattractor22"

11 ビュー (過去 30 日間)
Bentil A.K.
Bentil A.K. 2018 年 1 月 24 日
コメント済み: Numan 2023 年 7 月 12 日
Have these codes but when i tried, it gives ...
function chenattractor22
|
Error: Function definitions are not permitted in this context.
function chenattractor22
clc;clear
global a b c
a=0;b=0;c=0;
[T,Y] = ode45(@chen,[0:0.01:100],[-1 -1 1] );
plot3( Y(end-5000:end,1), Y(end-5000:end,2),Y(end-5000:end,3),'k.');grid on
xlabel('x');ylabel('y');zlabel('z')

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 24 日
You need to store that code in a file chenattractor22.m
  3 件のコメント
Steven Lord
Steven Lord 2018 年 1 月 24 日
  • Open the Editor using this command:
edit
  • Write your function code into the document that opened when you called edit. See the pages in this section of the documentation if you're not sure how to write a function file.
  • Save your function file in the current directory (as long as your current directory is not under the directory returned by the matlabroot function) or in a directory on the MATLAB search path. This will ensure MATLAB can find the file when you try to call it. Name your function file the same name as the main function, but add the .m extension (or let the Editor add the extension for you.)
  • Run your function.
Numan
Numan 2023 年 7 月 12 日
hello have you got the whole program please

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by