how to use nested for loop by grabbing one column and subtracting another column.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
so i have this huge file that is 1478 by 1236 matrix and i want to calculate the xslope and yslope as follows
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171648/image.jpeg)
Respuestas (1)
Roger Stafford
el 29 de Mzo. de 2018
Editada: Roger Stafford
el 29 de Mzo. de 2018
Your n value will be 1478, but in z(i,j+1) you have allowed the j+1 index to get as large as 1479 because you have "for j=1:1:n" and its maximum value should be only 1236. Hence the error message. You need to do
[n,m] = size(z)
and
for j = 1:m-1
0 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!