Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
variables from a function in my workspace

Subject: variables from a function in my workspace

From: Hermano Cappa

Date: 22 Jan, 2010 08:41:02

Message: 1 of 2

Hello,

I'm making a program with a lot of functions. But I can't get some variables from a function in my workspace. How can I do this?

Kind regards

Subject: variables from a function in my workspace

From: Loren Shure

Date: 22 Jan, 2010 15:05:44

Message: 2 of 2

In article <hjboau$ekr$1@fred.mathworks.com>, cappasteven@gmail.com
says...
> Hello,
>
> I'm making a program with a lot of functions. But I can't get some variables from a function in my workspace. How can I do this?
>
> Kind regards
>

Your function needs to return the values on the left-hand side and you
need to call your function with left-hand side outputs. E.g.,

function [a,b,c] = foo(k)
....
end

[mya, myb, myc] = foo(1:9)

--
Loren
http://blogs.mathworks.com/loren

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us