How to number permutation values, 11, 12, 13, 14, etc in "for" loop to be sequentially printed as 1, 2, 3 etc?

1 view (last 30 days)
Hi, I am running my simulation using "for" loop. The problem is that I have "i" and "j" orders on which I refer to each value, like 11, 12, 13, 14, etc. I need to, instead, mark them as 1, 2, 3, 4, 5, etc. Is there anyway to do that? Thank you very much.
  2 Comments
Ismail Qeshta
Ismail Qeshta on 12 Nov 2017
Hi Walter. Basically, I have a=[ 1 2 3] and b= [1 2 3] and I am running for loop for i = 1:3, and j= 1:3; I need to print the output in terms of 1, 2, 3, 4, etc, instead of 11, 12, 13, 14, etc.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 12 Nov 2017
(i-1)*3 + j

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!