Could you guys explain me how to get a value back in a case like this...?

3 ビュー (過去 30 日間)
Douglas Alves
Douglas Alves 2014 年 6 月 18 日
回答済み: Dishant Arora 2014 年 6 月 19 日
I Have a line in a program
P0=fzero(@(P0) estimateSurfacePressure(P0,false,extPar), [1 25]);
and inside estimateSurfacePressure I have
function [Ps,Rs]=estimateSurfacePressure(P0,isCompressed,extPar)
but inside this file I modify extPar... (extPar is a structure).
I thought that putting extPar in function [Ps,Rs,extPar] = ....Pressure(P0,isCompressed,extPar)
and modifying P0 to [P0,~,~,~,extPar] = fzero(.........) would give me extPar modified the way I want it to. But it doesn`t! How should I set this up so it gives me extPar not how it came in but how it should be after being modified in estimateSurfacePressure.m
Thank you!

採用された回答

Dishant Arora
Dishant Arora 2014 年 6 月 19 日
Make use of global variables or see assignin

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by