Using variable as part of name to extract sequentially named columns from imported table
Show older comments
Hi everyone,
As part of a program I'm trying to graph multiple sets of data from an imported table from an exel file, "data". These data sets are sequentially titled (Force, Force_1, Force_2, etc.), and I'm trying to graph everything using a for loop, and the iterating variable as part of the coloumn. The columns aren't sequential in the table, so using the name appears to be the most efficient choice. Does anyone have advice on the best way to do this? Thanks!
disp("Graphing start")
for i=1:wmod
force=data.Force_"(wmod)";
stroke=data.Stroke_"(wmod)";
plot(stroke,force)
hold on
end
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!