Can I generate matrix having decimal coordinates.

I have a 3x3 simple matrix 1 to 9,
M=[1,2,3;4,5,6;7,8,9]
[x,y] = find(M)
x = [1 2 3 1 2 3 1 2 3]
y = [1 1 1 2 2 2 3 3 3]
I rotated the coordinates and got these values
xr = [0.7 0.4 0.2 1.7 1.4 1.2 2.6 2.4 2.1]
yr = [1.2 2.2 3.2 1.5 2.4 3.4 1.7 2.7 3.7]
now i want to assign matrix elements at these rotated coordinates.
is it possible to generate decimal coordinate matrix or how to assign them ?
Thanks for the help in advance!

回答 (1 件)

Jan
Jan 2018 年 8 月 6 日

0 投票

No. Indices must be positive integers. Of course.
It seems like a trivial solution not to use indices, but to use your data as they are currently:
M = [1,2,3; 4,5,6; 7,8,9]
xr = [0.7 0.4 0.2 1.7 1.4 1.2 2.6 2.4 2.1]
yr = [1.2 2.2 3.2 1.5 2.4 3.4 1.7 2.7 3.7]
These are the available information and they are directly accessible. What ever you want to do with the data, you can do it with this representation.

カテゴリ

ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索

質問済み:

2018 年 8 月 6 日

回答済み:

Jan
2018 年 8 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by