Do I need to add something to use squeeze function?

Hi, I have used the squeeze function however it doesn't appear to have worked - do I need to add something else into my code for the squeeze function to work?
data_extract=tas_sh(154:159,14:22,:);
data_extract_squeeze=squeeze(data_extract);
figure;
plot(data_extract_squeeze)
data_extract produce a 6x9x3012 value
data_extract_squeeze also produces a 6x0x3012 value

댓글 수: 3

"I have used the squeeze function however it doesn't appear to have worked"
Given that the array you provided to squeeze has no singleton dimensions, what do you expect squeeze to do?
I didn't realise that it had to have a dimension that was 1. Is there another way I can make this data 2D as I currently can't plot it?
"Is there another way I can make this data 2D as I currently can't plot it?"
Of course, there are other ways, but as you did not specify how you want the data rearranged, I cannot hazard a guess as to which way suits your needs best. Possibly some combination of permute and reshape might do what you want.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2021년 5월 5일

댓글:

2021년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by