How can I use a function answer as a variable in another function?

2 ビュー (過去 30 日間)
Brianna Biondo
Brianna Biondo 2021 年 6 月 23 日
コメント済み: dpb 2021 年 6 月 23 日
I need to make a function dXdt. One of the variables is N. N is found with the function dNdt, so N has multiple answers, 145 x 1 is the array made. which doesnt work very well as a variable. I cant do a nested function because N is needed and N is not in the function of the original equation. How would I use the solution of dNdt as a variable? Would I need a for loop? And if so how would I go about doing that for an array so large?
  2 件のコメント
millercommamatt
millercommamatt 2021 年 6 月 23 日
does dXdt only accept scalars?
dpb
dpb 2021 年 6 月 23 日
"N has multiple answers, 145 x 1 is the array made. which doesnt work very well as a variable"
N is a perfectly valid variable name for a vector array -- what's wrong with just passing it to the function?
We would have to see the definition of the function dXdt; it would, of course, have to know what to do with the vector input (but it'll have to be able to handle a145 single inputs otherwise which, if you think a vector is cumbersome, just try writing that!!! :) )

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by