Subscripted assignment dimension mismatch error in valsx. How do I get rid of the error?

for alpha=20:1:100; l =((k'*covinv)*mu - alpha)/((k'*covinv)*k); x= (1/alpha)*covinv*(mu-l*k); valsx(count,:)=x'; f(count)=0.5*alpha*(.....); count=count+1; end

Answers (1)

It is impossible to be sure about the cause of your error because you haven’t defined the nature of your various variables. However I will speculate that the quantity x’ is a column vector and valsx(count,:) is expecting a row vector to be input. Or possibly x’ is a row vector of the wrong length.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 3 Dec 2016

Answered:

on 3 Dec 2016

Community Treasure Hunt

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

Start Hunting!