Cell array creation
📖 Scenario: You are organizing a small collection of different types of data about fruits. You want to store their names, colors, and average weights together in a flexible container.
🎯 Goal: Create a cell array in MATLAB that holds the fruit names, their colors, and their average weights. Then, display the cell array.
📋 What You'll Learn
Create a cell array called
fruits with exactly three rows and two columns.The first row should contain the fruit names:
'Apple' and 'Banana'.The second row should contain the colors:
'Red' and 'Yellow'.The third row should contain the average weights in grams:
150 and 120.Display the entire
fruits cell array using disp.💡 Why This Matters
🌍 Real World
Cell arrays let you store mixed data types together, like names, numbers, and descriptions, which is common in data analysis and reporting.
💼 Career
Knowing how to create and manipulate cell arrays is useful for engineers and scientists who work with diverse datasets in MATLAB.
Progress0 / 4 steps