From: Mohammed Forhad on
Hello!
I want to plot a function of the form :
y=ax^-b, where, a, b>0

how can I plot this function in matlab
From: Manjusha Venkataramani on
clear all;
clc;
close all;
a=15;
b=5;
x=[1:20];
y=power((a*x),-b);
plot(x,y);
..
From: Walter Roberson on
Mohammed Forhad wrote:

> I want to plot a function of the form :
> y=ax^-b, where, a, b>0
>
> how can I plot this function in matlab

What happens if x is 0 ?
From: Aaron Clarke on
% This is just toy data - substitute your data here
PSD = 0:pi/100:4*pi;
frequency = cos(PSD );
time = sin(PSD );

% Plot the data
figure; plot3(frequency,time,PSD ,'r-');

% Change the properties of the current axis
set(gca,'YTick',[-1 0 1],'YTickLabel',['time-1';'time-2';'time-3']);

xlabel('Frequency');
ylabel('Time');
zlabel('PSD');

"Md. Niazul " <niaz.eee04(a)gmail.com> wrote in message <i0qk35$ajf$1(a)fred.mathworks.com>...
> hello all,
> I am in a problem.my problem is to give labels to specific points on a axis.for example in 3-D plot , i have a plot of PSD at different times (PSD along z-axis,frequency along x-axis and time along y-axis). I need to label y-axis for different times (for example, time-1, time-2,time-3,,,etc).help me pls.thanx
From: Md. Niazul on
thanx for ur reply.Can I use this for surf() function instead of plot3()?


"Aaron Clarke" <aaron.clarke(a)utoronto.ca> wrote in message <i18qss$sj$1(a)fred.mathworks.com>...
> % This is just toy data - substitute your data here
> PSD = 0:pi/100:4*pi;
> frequency = cos(PSD );
> time = sin(PSD );
>
> % Plot the data
> figure; plot3(frequency,time,PSD ,'r-');
>
> % Change the properties of the current axis
> set(gca,'YTick',[-1 0 1],'YTickLabel',['time-1';'time-2';'time-3']);
>
> xlabel('Frequency');
> ylabel('Time');
> zlabel('PSD');
>
> "Md. Niazul " <niaz.eee04(a)gmail.com> wrote in message <i0qk35$ajf$1(a)fred.mathworks.com>...
> > hello all,
> > I am in a problem.my problem is to give labels to specific points on a axis.for example in 3-D plot , i have a plot of PSD at different times (PSD along z-axis,frequency along x-axis and time along y-axis). I need to label y-axis for different times (for example, time-1, time-2,time-3,,,etc).help me pls.thanx