% question in matlab for statement.

Asked 2 years ago, Updated 2 years ago, 95 views

I'm looking at the example of that gunfire

Python is

fori in range (19) I wrote it like this

Matte wrap is

fori = 1:19

I have a question.

Among Matlab examples

for i = 1%:100

Or

for i = 3%:100

Looking at these examples, do you know what 1% and 3% mean?

Is it up to 100 by 1 percent or 100 by 3 percent?

for matlab python language

2022-09-20 19:07

1 Answers

In Matlab, % is a reserved word that marks the beginning of an annotation.

% followed by comments.

I think it's probably a code that's annotated for the test process.

For example, the original code is to repeat 100 times as follows

for i=1:100

To find a bug, or to see the processing results for a specific constant value

for i=1%:100

If you comment as above, it will be the same as the code below.

for i=1

You can only see the result when i is 1.

In conclusion, it looks like we're temporarily annotating it to find a bug, or to see the result of i being a specific constant.


2022-09-20 19:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.