Reduce the size of Matrix from 100x100 to 35x11

조회 수: 2 (최근 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
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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by