hello, I am stuck at this part of my code
1 次查看(过去 30 天)
显示 更早的评论
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
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
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!