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!

Risposte (1)

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.

Categorie

Richiesto:

il 6 Ago 2018

Risposto:

Jan
il 6 Ago 2018

Community Treasure Hunt

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

Start Hunting!

Translated by