- #1
parislad
- 19
- 0
Hi, I'm new to this forum and only have a few months experience with MATLAB but am getting to know it. Hope you can help me.
I have a for loop which looks like:
for f = a:a:b
command
end
Now,
I only want to execute this command for the integer values in this loop.
eg. if it was f=0.2:0.2:6.2
I only want to run the code for the integer values f=1,2,3,4,5, and 6.
The problem is a and b are values input by the user, so I'm unsure how to do it.
Any help will be appreciated.
Thanks in advance.
Ben
I have a for loop which looks like:
for f = a:a:b
command
end
Now,
I only want to execute this command for the integer values in this loop.
eg. if it was f=0.2:0.2:6.2
I only want to run the code for the integer values f=1,2,3,4,5, and 6.
The problem is a and b are values input by the user, so I'm unsure how to do it.
Any help will be appreciated.
Thanks in advance.
Ben