Matlab inverse matrix

  • Follow


hello all around,

have some problems with matlab with this script (newbie here, should I
precise)


p=[0:0.01:1];
t=(((p/(1.48))+((1-p)*(170E-3))));
v=1/t;



figure(2)
plot(p,v)
xlabel('porosity (%)')
ylabel('velocity (km/s)')


the corresponding error message is :

??? Error using ==> mrdivide
Matrix dimensions must agree.

Error in ==> geovthirdalternative at 33
v=1/t;


I guess that it might a little more complicated to inverse a vector...
Have you any hints to fix this situation ?

pretty thanks !!
0
Reply zoubbly 11/16/2010 4:00:27 PM

zoubbly <martin.stab@gmail.com> wrote in message <8dde9bb7-2f73-4001-a1e7-f214976a35de@r14g2000yqa.googlegroups.com>...
> hello all around,
> 
> have some problems with matlab with this script (newbie here, should I
> precise)
> 
> 
> p=[0:0.01:1];
> t=(((p/(1.48))+((1-p)*(170E-3))));
> v=1/t;
> 
> 
> 
> figure(2)
> plot(p,v)
> xlabel('porosity (%)')
> ylabel('velocity (km/s)')
> 
> 
> the corresponding error message is :
> 
> ??? Error using ==> mrdivide
> Matrix dimensions must agree.
> 
> Error in ==> geovthirdalternative at 33
> v=1/t;
> 
> 
> I guess that it might a little more complicated to inverse a vector...
> Have you any hints to fix this situation ?
> 
> pretty thanks !!

Use the element-wise operator with a dot  ./

 v=1./t;

James Tursa
0
Reply James 11/16/2010 4:13:03 PM


1 Replies
407 Views

(page loaded in 0.081 seconds)

Similiar Articles:













7/23/2012 3:22:00 PM


Reply: