Pergunta

I am trying to create a master dataSheet using bits of other matrices located in the workspace. This visual representation should show what I am trying to achieve:

http://i.imgur.com/A1HtQI3.png

The arrows indicate the different arrays I am trying to combine. So far 1 to 3 are quite simple. But I cannot figure out how to move 4. The problem is I want it to start at dataSheet(4,1) and go all the way down, but I am getting indexing errors for the things I have tried.

dataSheet = fitVal(:,1)';
dataSheet(2,:) = fitVal(:,2)';
dataSheet(3,:) = 360*asin((1/4)*dataSheet(2,:)*(632.8*1e-9)/(pi*1.332))*(10^6)/pi;
dataSheet(4:length(isf(:,1)),1) = isf(:,1); ?????????????

Any help would be apprecaited. Thanks

Foi útil?

Solução

Try this:

nrows = size(isf, 1);
dataSheet(3 + (1:nrows),1) = isf(:,1);

That should do it.

You were trying to put nrows elements into nrows - 3 rows... that's why Matlab was complaining.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top