필터 지우기
필터 지우기

hello, I am stuck at this part of my code

조회 수: 3 (최근 30일)
Christian Benjamin
Christian Benjamin 2022년 12월 12일
답변: Dongyue 2022년 12월 15일
I have to use specific data gathered in a generated cell array to properly output the data sets.
this is what i have so far
Data is the generated matrix that i have to gather data from. its size differs depending on what genre is being shown. i need help with figuring out how to splice out the specific row that corresponds with what the user wants to watch (the values in my first column that they can choose) in order to output data points from said row. i've also attached the code and excel file i am working from
MoviesinGenre = Data
Moviegenrechoice = input('Which movie do you want to watch\n(Pick one of the movie names in the given matrix)','s')
while strcmpi(MoviesinGenre(:,1),'Moviegenrechoice')
Moviegenrechoice = input('Error. Pick a movie listed in the array')
end
fprintf('The movie you have chosen is %s.\n',Moviegenrechoice)
Moviegenrechoicerow = MoviesinGenre(Moviegenrechoice,:)
  댓글 수: 1
Image Analyst
Image Analyst 2022년 12월 12일
I'm not seeing where you attached Data.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

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

답변 (1개)

Dongyue
Dongyue 2022년 12월 15일
Hi Christian,
I have updated your script, please check the attached file.
BTW, I still recommend you to use the table instead of the cell to do the data visiualization. It is much easier to use table for indexing and data processing.
Please read through the documentation for Data Table,
Best,
Dongyue

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by