Reduce the size of Matrix from 100x100 to 35x11

1 回表示 (過去 30 日間)
Raghu Vamsi Kodaboina
Raghu Vamsi Kodaboina 2024 年 11 月 26 日
編集済み: John D'Errico 2024 年 11 月 26 日
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 件のコメント
Stephen23
Stephen23 2024 年 11 月 26 日
John D'Errico
John D'Errico 2024 年 11 月 26 日
編集済み: John D'Errico 2024 年 11 月 26 日
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.

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

回答 (1 件)

Torsten
Torsten 2024 年 11 月 26 日
x1 = x1(1:35,1:11)
  2 件のコメント
Raghu Vamsi Kodaboina
Raghu Vamsi Kodaboina 2024 年 11 月 26 日
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 2024 年 11 月 26 日
As @Stephen23 commented: Use interp2.

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

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by