Effacer les filtres
Effacer les filtres

fplot command what is the default resolution ?

3 vues (au cours des 30 derniers jours)
tomer polsky
tomer polsky le 28 Avr 2019
Réponse apportée : dpb le 28 Avr 2019
lets say i have this code :
clc; clear all;
close all;
x=0:0.1:5;
f='3*exp(-x).*sin(x)';
fplot(f,[0 8],'b') title(f) xlabel('x') ylabel('y') grid on;
I am a bit counfused with this fplot command ? becouse the the [0 8 ] means the the plot is betwen 0 to 8 how ever what is the size of axes x ? if I will use plot command then I have X and Y ,and X is a vector however in the flpot command my X is not a vector but an array ... how is this possible ?

Réponses (1)

dpb
dpb le 28 Avr 2019
clear x
f=@(x) 3*exp(-x).*sin(x);
fplot(f,[0 8],'b')
will produce the same plot -- fplot doesn't use your x array at all; it computes x internally and uses a number of points dependent upon the range given to provide (hopefully) a smooth plot. Try
hAx=gca;numel(hAx.Children.XData)
afterwards if you change the range or use the default range and see what you get...
Also NB: the string form for the functional is deprecated usage; use the alternate function handle instead.

Catégories

En savoir plus sur Visual Exploration dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by