Error Using * and ^
I am trying to ;
varV = sqrt(s^2*var(‘Texaco’)^2 + (1-s)^2*var(‘Exxon’)^2 + 2*s*(1-s)*cov(Texaco,Exxon))
but it gives me
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
After I arrange like this :
varV = sqrt((s.^2)*var(Texaco).^2 + ((1-s).^2)*var(Exxon).^2 + 2*s*(1-s)*cov(Texaco,Exxon))
It gives me :
Error using *
Inner matrix dimensions must agree.
How can I arrange this correctly ?
Note:Texaco and Exxon are my imported datas.I am trying to ;
varV = sqrt(s^2*var(‘Texaco’)^2 + (1-s)^2*var(‘Exxon’)^2 + 2*s*(1-s)*cov(Texaco,Exxon))
but it gives me
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
After I arrange like this :
varV = sqrt((s.^2)*var(Texaco).^2 + ((1-s).^2)*var(Exxon).^2 + 2*s*(1-s)*cov(Texaco,Exxon))
It gives me :
Error using *
Inner matrix dimensions must agree.
How can I arrange this correctly ?
Note:Texaco and Exxon are my imported datas. I am trying to ;
varV = sqrt(s^2*var(‘Texaco’)^2 + (1-s)^2*var(‘Exxon’)^2 + 2*s*(1-s)*cov(Texaco,Exxon))
but it gives me
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
After I arrange like this :
varV = sqrt((s.^2)*var(Texaco).^2 + ((1-s).^2)*var(Exxon).^2 + 2*s*(1-s)*cov(Texaco,Exxon))
It gives me :
Error using *
Inner matrix dimensions must agree.
How can I arrange this correctly ?
Note:Texaco and Exxon are my imported datas. error * ^ MATLAB Answers — New Questions