Hello Divya,
The error message indicates that the data you're attempting to plot is not in a format that MATLAB's plot function can handle. To resolve this issue, you need to ensure that the data you're trying to plot is numeric, datetime, duration, or an array that can be converted to a double type. Here are several steps and checks you can perform to troubleshoot and solve this problem:
1. Check the Data Type: Verify the data type of the variables you’re trying to plot by using “whos” command. For example:
whos myVariable;
If your variable is not a numeric, datetime, or duration type, you’ll need to convert it or extract the relevant numeric data for plotting.
2. Convert or Extract Numeric Data: If your data is stored in a table, structure, or object, you might need to extract the numeric data before plotting. For instance, if your data is in a table:
numericData = table2array(myTableVariable);
plot(numericData);
For objects, you might need to access the specific property that holds the numeric data:numericData = myObject.NumericProperty;plot(numericData);
3. Ensure Compatibility with Plot Function: The plot function typically expects vector.
Please refer to the following links to know further about related queries:
- Plot function (Mathworks documentation): https://in.mathworks.com/help/matlab/ref/plot.html?searchHighlight=plot&s_tid=srchtitle_support_results_1_plot
- vehicleCostmap planner straight line 90 degrees path (ML Answer): https://www.mathworks.com/matlabcentral/answers/1947643-vehiclecostmap-planner-straight-line-90-degrees-path?s_tid=answers_rc1-2_p2_MLT
- vehicleCostmap (Mathworks documentation): https://www.mathworks.com/help/driving/ref/vehiclecostmap.html?s_tid=answers_rc2-2_p5_MLT
Hope this helps!