Can I multiply a Vector with a Matrix?

조회 수: 1 (최근 30일)
Edoardo
Edoardo 2012년 10월 30일
Hi;
Sorry for my english. I've a big problem, I want multiply a vector by a matrix:
A part of my code is:
[...]
x = -5000:10.:5000;
y = -5000:10.:5000;
[X,Y]=meshgrid(x);
U= []; %is an array <1x15000 double>
teta=[]; %is an array <1x15000 double>
%condizioni iniziali
if U <= 5500
rho = 0.1;
else U> 5500;
rho = 0.16;
end
u = ((DeltaH/Hsor)^rho).*U ;
%velocità del vento corretta
h = Hsor+DeltaH-((vg*2.1./u));
%altezza considerando la sedimentazione in atmosfera
dd=((270-teta)*pi)/180;
%Modifica direzione vento
x11 = cos(dd);
x111 = x11*X;
[...]
I've a problem in the last operation ??? Error using ==> mtimes Inner matrix dimensions must agree.
Error in ==> SCORMAT at 90
x111 = x11*X;
[EDITED, Jan, code formatted]
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 30일
what is
if U 5500 rho = 0.1; else U 5500; rho = 0.16; end
Edoardo
Edoardo 2012년 10월 30일
U is wind speed and rho is a variable that change when change U

댓글을 달려면 로그인하십시오.

채택된 답변

Sachin Ganjare
Sachin Ganjare 2012년 10월 30일
Change x11*X to x11.*X
  댓글 수: 1
Edoardo
Edoardo 2012년 10월 30일
Matrix dimensions must agree.
Error in ==> SCORMAT at 90 x111 = x11.*X;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by