I all, I have to solve thise equation VFA=408.5 +25.4 pH + 33.9 COD/N -1.8 pH x COD/N +1.8 pH2 -0.3 COD/N2
where pH is a column vector and COD/N is a row vector (10000 numbers).
the result should be a matrix...
Thanks for the help!!

 採用された回答

Walter Roberson
Walter Roberson 2016 年 4 月 18 日

0 投票

Use ndgrid() or meshgrid() and vectorize your expressions. You will need to figure out what pH2 and N2 are, though.

6 件のコメント

mirko d'antoni
mirko d'antoni 2016 年 4 月 18 日
Hi, thanks for your answer. Basically I want built a matrix using the equation reported previously. The problem is that pH is a column vector and COD/N is a row vector... so I can't do the sum. I don't now how solve this problem. I tried to use meshgrid()but doesn't works.
Torsten
Torsten 2016 年 4 月 18 日
Use pH and transpose(COD/N).
Best wishes
Torsten.
mirko d'antoni
mirko d'antoni 2016 年 4 月 18 日
編集済み: mirko d'antoni 2016 年 4 月 18 日
Sorry, maybe I have not explained well.. the results that I want is this one.. Thanks
mirko d'antoni
mirko d'antoni 2016 年 4 月 18 日
calculate each cell.. apply this equation in each cell in function of corresponding pH and COD/N values.
mirko d'antoni
mirko d'antoni 2016 年 4 月 18 日
Yessss thanks for the huge help!!!
Walter Roberson
Walter Roberson 2016 年 4 月 18 日
[gpH, gCODN] = ndgrid(pH, COD/n);
VFA = 408.5 + 25.4 * gpH + 33.9 * gCODN - 1.8 * gpH .* gCODN + 1.8 * gpH.^2 - 0.3 * gCODN.^2;
Note: I have interpreted COD/N2 here as (COD/N)^2 . If it was intended to be COD/(N^2) then the above code is not correct.

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by