フィルターのクリア

I keep getting the error using '/'.

3 ビュー (過去 30 日間)
Adwait Mahajan
Adwait Mahajan 2024 年 3 月 8 日
コメント済み: Adwait Mahajan 2024 年 3 月 8 日
"Error using /
Arguments must be numeric, char, or logical. "
I have a 64X1 matrix of vol_frac and particle_ratio each. 'c' goes from 1 to 64 using for loop. Please tell me what is going wrong and how to rectify it. I have tried writing "vf=vol_frac(c,1);" inside for loop so that vf isn't a matrix but still same problem.
mu_ratio=(1-(vol_frac(c,1)/0.605)*((particle_ratio(c,1))^1.2))^(-1.5125);
  2 件のコメント
Rik
Rik 2024 年 3 月 8 日
Try to make a MWE so we can run your code without any other dependencies and can reproduce your issue. The best way to do this is to use the code section in the editor and use the run button. That way you can make sure we will see the same error message as you do.
Adwait Mahajan
Adwait Mahajan 2024 年 3 月 8 日
The equation is under For loop so need to extract single value from vol_frac matrix. Don't want matrix division.

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

回答 (2 件)

Alan Stevens
Alan Stevens 2024 年 3 月 8 日
Try
mu_ratio=(1-(vol_frac(c,1)/0.605).*((particle_ratio(c,1)).^1.2)).^(-1.5125);
Notice the dots! .* .^
Difficult to be certain though. You should upload enough program for us to test.
  3 件のコメント
Adwait Mahajan
Adwait Mahajan 2024 年 3 月 8 日
Not the whole code.
Dyuman Joshi
Dyuman Joshi 2024 年 3 月 8 日

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


VBBV
VBBV 2024 年 3 月 8 日
condition=readmatrix('cases.xlsx','Sheet',1,'Range','A2:C65');
  2 件のコメント
VBBV
VBBV 2024 年 3 月 8 日
use readmatrix function in place of readtable and run the code. The outputs from readtable are usually not numeric arrays
Adwait Mahajan
Adwait Mahajan 2024 年 3 月 8 日
thanks.

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

カテゴリ

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

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by