Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

how do i make an expression to the left of the equals sign a valid target so i can get rid of this error?

1 visualización (últimos 30 días)
[find(stock.permno)]==notrading(1);
for i=1:18522
if i=10137
newt=((find (toremove(i)==c)),:)=[];
for i=0:4
t((1+(i*126)):(126+(i*126)),:)=c((253+(i*378)):(379+(i*378)),:);
end
for i=1:5
trade(i).permno=top5(i,1);
for ii=0:4
trade(ii+1).price=d(1+(ii*252):252+(ii*252),4);
end

Respuestas (1)

Jan
Jan el 23 de Nov. de 2017
Please post the complete error message, if you mention, that there is a problem. Thanks.
This will fail also:
newt = ((find(toremove(i)==c)),:) = [];
It is hard to guess the intention of wrong code. So please explain, what this line should do, such that we can post the correct version without confusing you with guessed code.
This line is suspivious:
t((1+(i*126)):(126+(i*126)),:)=c((253+(i*378)):(379+(i*378)),:);
For e.g. i=1 you get:
t(127:252,:)=c(631:757,:);
This is 126 elements on the right side and 125 elements on the left. The assignment cannot work.
What is the prupose of this line:
[find(stock.permno)]==notrading(1);
The comparison with == is not useful here, because the result is not stored anywhere.
Add comments to your code, which define the purpose of every single line of code. This helps at writing and debugging the code. Having just the failing code does not allow to draw conclusions about its purpose - neither for the readers in the forum, nor for yourself, if you want to modify the code in 2 months.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by