Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab attemp to execute script as a function

Status
Not open for further replies.

STOIKOV

Full Member level 4
Joined
Nov 18, 2005
Messages
236
Helped
8
Reputation
16
Reaction score
2
Trophy points
1,298
Activity points
3,083
matlab attempt to execute script as a function

I have an error when trying to plot a polar chart in matlab:

% polar plot of z
r = 1.2; theta = 10*pi/180;
angle = 0:theta:36*theta; mag = r.^(angle/theta);
polar(angle,mag)
grid
title('Polar Plot')

Attempt to execute SCRIPT polar as a function.
On line 4 ==> polar(angle,mag)

Thanks.
 

hr_rezaee

Advanced Member level 3
Joined
Oct 6, 2004
Messages
751
Helped
109
Reputation
218
Reaction score
24
Trophy points
1,298
Location
Iran-Mashhad
Activity points
4,025
attempt to execute script as a function

hi
i ran your program in matlab 7 and it worked successfully.
i think error belong to "angle" because it is one of matlab functions.
use:

r = 1.2; theta = 10*pi/180;
ang = 0:theta:36*theta; mag = r.^(ang/theta);
polar(ang,mag)
grid
title('Polar Plot')
 

    STOIKOV

    Points: 2
    Helpful Answer Positive Rating

STOIKOV

Full Member level 4
Joined
Nov 18, 2005
Messages
236
Helped
8
Reputation
16
Reaction score
2
Trophy points
1,298
Activity points
3,083
attempt to execute script as a function

I got the same error. Have installed version 5.3, how can I verify what functions I have available ? You got a polar chart when run it ?

Tks.
 

hr_rezaee

Advanced Member level 3
Joined
Oct 6, 2004
Messages
751
Helped
109
Reputation
218
Reaction score
24
Trophy points
1,298
Location
Iran-Mashhad
Activity points
4,025
attempt to execute script as a function:

you can search in matlab directory for file <function_nmae>.m .
yes i have a graph.
 

    STOIKOV

    Points: 2
    Helpful Answer Positive Rating

Atzakas

Newbie level 6
Joined
Nov 22, 2005
Messages
11
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,383
attempt to execute script as a function matlab

Try changing the name of your script file. Use something else instead of 'polar'
 

    STOIKOV

    Points: 2
    Helpful Answer Positive Rating

STOIKOV

Full Member level 4
Joined
Nov 18, 2005
Messages
236
Helped
8
Reputation
16
Reaction score
2
Trophy points
1,298
Activity points
3,083
attempt to execute script input as a function.

it works by changing the name of the file as you suggested.
Thanks to all.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top