What while loop can be used here to stop Matlab giving me any reminder?

1 visualización (últimos 30 días)
Hdez
Hdez el 16 de Nov. de 2020
Respondida: David Hill el 16 de Nov. de 2020
I don't want Matlab to give me any reminder resulsts in the hx or hy, just integer numbers.
h= input('Enter the desire grid spacing:');
hx=(lx/h)+ 1; %NC
hy=(ly/h)+ 1; %NR

Respuestas (1)

David Hill
David Hill el 16 de Nov. de 2020
Use floor and ceil
hx=floor(lx/h)+1;
hy=ceil(ly/h)+1;

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by