plot(t,wave1,'r-','linewidth', 3); hold on in matlab

The function plot in matlab is used to plot graphs. The hold on command is used to add additional graphs to the same plot. Here is the code to plot wave1 with a red line:

main.m
plot(t, wave1,'r-', 'linewidth', 3);
hold on;
46 chars
3 lines

This will plot wave1 with a solid red line and a linewidth of 3. The hold on command will keep the current figure open and allow you to add additional graphs to the same plot.

related categories

gistlibby LogSnag