Inner matrix dimensions must agree

1 Ansicht (letzte 30 Tage)
Chanaka Navarathna
Chanaka Navarathna am 29 Jan. 2019
Hi,
I am getting this error whenever I run this code. What am I missing here?
Error using *
Inner matrix dimensions must agree.
C=2;
N=10000;
L=6.022*10^23;
edge1=500*10^(-8);
edge2=1*10^(-5);
edge3=2*10^(-5);
V=(edge1+randn(1,N))*(edge2+randn(1,N))*(edge3+randn(1,N));
M=volume*C*10^(-12)*L;
hist(M,10000)

Akzeptierte Antwort

madhan ravi
madhan ravi am 29 Jan. 2019
  2 Kommentare
madhan ravi
madhan ravi am 29 Jan. 2019
Bearbeitet: madhan ravi am 31 Jan. 2019
Change volume to V
C=2;
N=10000;
L=6.022*10^23;
edge1=500*10^(-8);
edge2=1*10^(-5);
edge3=2*10^(-5);
V=(edge1+randn(1,N)).*(edge2+randn(1,N)).*(edge3+randn(1,N));
M=V*C*10^(-12)*L;
hist(M,10000)
Chanaka Navarathna
Chanaka Navarathna am 2 Feb. 2019
It has worked. Thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by