Could anyone explain me what a line like this works?
이전 댓글 표시
I've got 2 files the first file with a line (1) calls the file (2).
(1) P0=fzero(@(P0) estimateSurfacePressure(P0,false,extPar), [1 25])
(2) function [Ps,Rs]=estimateSurfacePressure(P0,isCompressed,extPar)
So what I know is a value for P0 is chosen between 1 and 25 and then the program will stop when a proper Ps is zero. (There's an fzero inside the 2nd file) what I don't understand is that since at the very last line it says P0 = Ps (so when the program runs P0 chosen by (1) was altered). Then after several times varying P0 in order to find Ps = 0 once it's found when the program comes back to the previous file where the line (1) is. What P0 is is actually the value chosen firstly in order to find Ps = 0 and not the value Ps itself. I thought P0 should be Ps because it's established at the botton of the file (2) P0 = Ps. How come does that happen?
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!