Reduce the size of Matrix from 100x100 to 35x11

1 Ansicht (letzte 30 Tage)
Raghu Vamsi Kodaboina
Raghu Vamsi Kodaboina am 26 Nov. 2024
Bearbeitet: John D'Errico am 26 Nov. 2024
Hi,
I have a matrix which is 100x100, let say for example x1 = randi([1, 100], [100,100]). Where x1 is the Z in a Map data and X and Y represent Speed and Torque.
Now the size of Speed and Torque in this case is 1x100 and 100x1 respectively.
Now it was easy to reduce the size of Speed and Torque to 1x11 and 35x1 defining a new variable.
Given the new speed and torque of different size, how can convert my Z (=x1) data into a matrix of 35x11 from 100x100.
I have attached my code, where New Speed and Torque values are generated as mentioned as a new variable as I know the start and end values, now I want to reduce actual matrix of BMEP which is 100x100 to 35x11, matching the speed and Torque values.
I tried to explain the issue and if there are further queires please let me know and I will try to be more precise with what I need.
Thank you
With Regards
Raghu
  2 Kommentare
John D'Errico
John D'Errico am 26 Nov. 2024
Bearbeitet: John D'Errico am 26 Nov. 2024
Your question is impossible to answer. @Torsten gave you one, and you did not like it. But you don't say what you want, even though you claim to have edited your answer.
For example, you might choose from the original data, by simply choossing random rows and columns. you might decide to use interplation (infinitely many ways to do so, the simplest being what @Stephen23 suggested, interp2. But even interp2 has various methods in it, all of which are equally valid.). You might decide to resample by avaraging your data. (Infinitely many ways to do so. in blocks, for example, or even by the use of conv2.)
So if you want good help, then make it possible to get good help.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Torsten
Torsten am 26 Nov. 2024
x1 = x1(1:35,1:11)
  2 Kommentare
Raghu Vamsi Kodaboina
Raghu Vamsi Kodaboina am 26 Nov. 2024
Hi Torsten,
Thank you for your reply.
But this is not the result I am expecting. This command, chooses the data from the first 35 columns and 11 Rows. While the result I am expecting is different.
I will edit my query again with the data I am using in the code.
Thanks again for the spontaneous reply.
Raghu
Torsten
Torsten am 26 Nov. 2024
As @Stephen23 commented: Use interp2.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by