displaying/returning two columns in matlab

조회 수: 3 (최근 30일)
Mohamed Jamal
Mohamed Jamal 2020년 8월 30일
답변: madhan ravi 2020년 8월 30일
Hi guys,
I have a function that returns output array of integers size 10 like [1 1 1 1 1 1 1 1 1 1 ] , what I want to do is that output to write aside every value of the array the sequence alphabet numbers order I mean to write aside every value of the output :
this is the output: (array of integers)
1
1
1
1
1
1
1
1
1
1
I need to write aside every value the sequence of alphabet numbers order (1 2 3 4 5 6 7 8 9 ..) so the output would be like this:
output sequence number
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
if output is bigger than 10 -in my case it's 10- then we complete 11 ..12 ..13..etc)
could anyone help me how I can do that in matlab? thanks alot for any help.

답변 (1개)

madhan ravi
madhan ravi 2020년 8월 30일
T = array2table([output_number(:), (1:numel(output_number)).'], 'VariableNames', {'Output Number', 'Sequence Number'})

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by