フィルターのクリア

Error Plotting a function - Matrix Dimensions must agree

2 ビュー (過去 30 日間)
Saumya Nagar 17BME0447
Saumya Nagar 17BME0447 2021 年 4 月 2 日
Hi,
I am new to MATLAB, I am getting the following error
"Error using / Matrix dimensions must agree.
Error in ParticleVelocityvsParticleSize (line 37)
VP1=M*((G*R*Stagnation_Temperature)/(1+((G-1)/2)*M^2))^0.5*((3*Cd*Gas_Density*x)/(2*Powder_Density*Powder_Size*10^(-6)))^0.5"
The code consists of getting the input of all the variables from the user. I need to plot the VP1 vs Powder_Size graph, with varying Powder_Size from 10 to 45.
Powder_Size=linspace(10,45,100)
VP1=M*((G*R*Stagnation_Temperature)/(1+((G-1)/2)*M^2))^0.5*((3*Cd*Gas_Density*x)/(2*Powder_Density*Powder_Size*10^(-6)))^0.5
plot(Powder_Size,VP1)
Can anyone please help me with this. Thanks in advance.
  1 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 4 月 2 日
hello
the error comes from the fact that you are not using dot product or dot division in your expression;

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

採用された回答

Shubham Khatri
Shubham Khatri 2021 年 4 月 6 日
Hello,
The error occurs because the matrix you are trying to multiply are not compatible with each other for multiplication due to the difference in number of elements in each matrix. Please check the size of each matrx you are multiplying and see if they can be multiplied. Also, if they are compatible, there is a need to use '.' (element operation) . For more information, please see this documentation link.
Hope it helps
  1 件のコメント
Saumya Nagar 17BME0447
Saumya Nagar 17BME0447 2021 年 4 月 9 日
Thank you Shubham for the help. It worked well!

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by