フィルターのクリア

Find row and column of specific array.

3 ビュー (過去 30 日間)
armin m
armin m 2021 年 11 月 28 日
コメント済み: armin m 2021 年 11 月 29 日
Hi. I want to find row and column of array in matrix. But with out using the find function. Because it finds the same numbers and put them in specific matrix. I want the code like this:
C=0
for j=1:10
C=C+1
[Rownum, colnum]=Q(j)
R(C,1)=Rownum
R(C,2)=colnum
end

採用された回答

Image Analyst
Image Analyst 2021 年 11 月 28 日
What is Q?
To get the rows and columns try the meshgrid() function:
x = 1 : 5; % 5 columns.
y = 1 : 4; % 4 rows.
[columnsArray, rowsArray] = meshgrid(x, y)
columnsArray = 4×5
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
rowsArray = 4×5
1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
  24 件のコメント
Image Analyst
Image Analyst 2021 年 11 月 29 日
@armin m, I don't know what the going rate is for custom programming in your country is.
"i write" doesn't make too much sense. It would be either
  1. "I am writing" meaning you have already begun and are currently writing for him.
  2. "I wrote" meaning you finished writing and are all done.
  3. "I will write" meaning you have not yet started to write but will write for him in the future.
As you can imagine, the hourly rate varies a lot from country to country. Usually you'll give them a cost estimate before you begin work so you also have to estimate the time it will take you to do the job.
armin m
armin m 2021 年 11 月 29 日
I am writing

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by