How can I run two functions in one script file?
古いコメントを表示
I have:
function [data]=input(user_defined_data)
%code that put the inputs in a cell array
end
function [output]=new_function_in_same_mfile(data)
%this should read the data array from the above function so I can do some calculations with it.
end
My problem is that MATLAB will run the first function but not the second. I have tried putting a readinput in between the functions, but MATLAB counts this as an error. I thought I needed a global variable, but when I tried to make data global, it won't accept data as global. How do I make the second function use the output from the first as an input, and run, in the same script file?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!