IEEERobotics/high-level

MATLAB visualization

Closed this issue · 4 comments

I'm trying to get a MATLAB script working properly, with very little background in MATLAB. I hope this will be obvious to someone with more experience, since I have lots of other work in the nav package that I need to focus on, and asking for help seems more efficient than continuing trying to debug MATLAB.

Using these files, I'd like to execute the MATLAB script and see the resulting visualization. The script takes two input files, a course description and a path solution. Two example pairs, env1.cfg/sol1.txt and env2.cfg/sol2.txt, are included in the previously linked Gist. It also takes a resolution, which I gave as .025 (same value used in env1.cfg). There is no other documentation on this script, most regrettably.

For my attempts, I reserved and used the Matlab R2012b (Win7) VM from NCSU's VCL. After storing those example files locally on the machine's Desktop, renaming the *.cfg files to be *.txt files so MATLAB can identify them, and adding my Desktop to MATLAB's path (when prompted), I ran:

>> plot_3Dpath('C:\Users\drfarrel\Desktop\sol1.txt', 'C:\Users\drfarrel\Desktop\env1.txt', .025)
reading in map of size 15 by 15

Which gives no apparent result other than the printed line I included above. Since I'm not getting any obvious errors, I'm not sure what's going wrong. There are no files generated and placed in MATLAB's directory or the Desktop. No new windows, like I would expect for a plot, are displayed.

How can I view the result of this script?

I'm guessing the problem is that you're ending your plot statements with
semicolons, which counter-intuitively means "suppress output" in MATLAB.

-Ethan

On Thu, Mar 21, 2013 at 4:16 AM, Daniel Farrell notifications@github.comwrote:

I'm trying to get a MATLAB script working properly, with very little
background in MATLAB. I hope this will be obvious to someone with more
experience, since I have lots of other work in the nav package that I need
to focus on, and asking for help seems more efficient than continuing
trying to debug MATLAB.

Using these files https://gist.github.com/dfarrell07/5210909, I'd like
to execute the MATLAB script and see the resulting visualization. The
script takes two input files, a course description and a path solution. Two
example pairs, env1.cfg/sol1.txt and env2.cfg/sol2.txt, are included in the
previously linked Gist. It also takes a resolution, which I gave as .025
(same value used in env1.cfg). There is no other documentation on this
script, most regrettably.

For my attempts, I reserved and used the Matlab R2012b (Win7) VM from
NCSU's VCL. After storing those example files locally on the machine's
Desktop, renaming the *.cfg files to be *.txt files so MATLAB can identify
them, and adding my Desktop to MATLAB's path (when prompted), I ran:

plot_3Dpath('C:\Users\drfarrel\Desktop\sol1.txt', 'C:\Users\drfarrel\Desktop\env1.txt', .025)reading in map of size 15 by 15

Which gives no apparent result other than the printed line I included
above. Since I'm not getting any obvious errors, I'm not sure what's going
wrong. There are no files generated and placed in MATLAB's directory or the
Desktop. No new windows, like I would expect for a plot, are displayed.

How can I view the result of this script?


Reply to this email directly or view it on GitHubhttps://github.com//issues/12
.

I would second Ethan's answer.

Matlab commands can all run with-out the semicolon's.

To actually see the output you are looking for, either un-semicolon the
line where that variable is stored to, or at the end of the script, simply
type the names of the specific outputs you want to see.

The only difference in the above is that in 1) the variable and its value
will be displayed every time that command executes, where as in 2)
the variable and value will be displayed only once, after every thing has
executed.

This is my short answer.

I am looking into it in more detail right now, and hope to have a more
complete answer for you soon.

Neal

On Thu, Mar 21, 2013 at 10:24 AM, ealamaster notifications@github.comwrote:

I'm guessing the problem is that you're ending your plot statements with
semicolons, which counter-intuitively means "suppress output" in MATLAB.

-Ethan

On Thu, Mar 21, 2013 at 4:16 AM, Daniel Farrell notifications@github.comwrote:

I'm trying to get a MATLAB script working properly, with very little
background in MATLAB. I hope this will be obvious to someone with more
experience, since I have lots of other work in the nav package that I
need
to focus on, and asking for help seems more efficient than continuing
trying to debug MATLAB.

Using these files https://gist.github.com/dfarrell07/5210909, I'd
like
to execute the MATLAB script and see the resulting visualization. The
script takes two input files, a course description and a path solution.
Two
example pairs, env1.cfg/sol1.txt and env2.cfg/sol2.txt, are included in
the
previously linked Gist. It also takes a resolution, which I gave as .025
(same value used in env1.cfg). There is no other documentation on this
script, most regrettably.

For my attempts, I reserved and used the Matlab R2012b (Win7) VM from
NCSU's VCL. After storing those example files locally on the machine's
Desktop, renaming the *.cfg files to be *.txt files so MATLAB can
identify
them, and adding my Desktop to MATLAB's path (when prompted), I ran:

plot_3Dpath('C:\Users\drfarrel\Desktop\sol1.txt',
'C:\Users\drfarrel\Desktop\env1.txt', .025)reading in map of size 15 by 15

Which gives no apparent result other than the printed line I included
above. Since I'm not getting any obvious errors, I'm not sure what's
going
wrong. There are no files generated and placed in MATLAB's directory or
the
Desktop. No new windows, like I would expect for a plot, are displayed.

How can I view the result of this script?


Reply to this email directly or view it on GitHub<
https://github.com/NCSUhardware/high-level/issues/12>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-15241308
.

Output_of_Sol1
Output_of_Sol2

Hey Daniel,

Actually, your code runs fine and does output a nice interactive plot.

See attached pictures for what I saw by running the same command and input
files you did.

I suspect there was an error in your VCL connection where it didn't
actually open the plot windows.

Let me know if I can help any further with Matlab stuff, as I'm feel pretty
decent with programming in Matlab.

Neal

On Thu, Mar 21, 2013 at 12:04 PM, Neal O'Hara ngo1991@gmail.com wrote:

I would second Ethan's answer.

Matlab commands can all run with-out the semicolon's.

To actually see the output you are looking for, either un-semicolon the
line where that variable is stored to, or at the end of the script, simply
type the names of the specific outputs you want to see.

The only difference in the above is that in 1) the variable and its value
will be displayed every time that command executes, where as in 2)
the variable and value will be displayed only once, after every thing has
executed.

This is my short answer.

I am looking into it in more detail right now, and hope to have a more
complete answer for you soon.

Neal

On Thu, Mar 21, 2013 at 10:24 AM, ealamaster notifications@github.comwrote:

I'm guessing the problem is that you're ending your plot statements with
semicolons, which counter-intuitively means "suppress output" in MATLAB.

-Ethan

On Thu, Mar 21, 2013 at 4:16 AM, Daniel Farrell notifications@github.comwrote:

I'm trying to get a MATLAB script working properly, with very little
background in MATLAB. I hope this will be obvious to someone with more
experience, since I have lots of other work in the nav package that I
need
to focus on, and asking for help seems more efficient than continuing
trying to debug MATLAB.

Using these files https://gist.github.com/dfarrell07/5210909, I'd
like
to execute the MATLAB script and see the resulting visualization. The
script takes two input files, a course description and a path solution.
Two
example pairs, env1.cfg/sol1.txt and env2.cfg/sol2.txt, are included in
the
previously linked Gist. It also takes a resolution, which I gave as
.025
(same value used in env1.cfg). There is no other documentation on this
script, most regrettably.

For my attempts, I reserved and used the Matlab R2012b (Win7) VM from
NCSU's VCL. After storing those example files locally on the machine's
Desktop, renaming the *.cfg files to be *.txt files so MATLAB can
identify
them, and adding my Desktop to MATLAB's path (when prompted), I ran:

plot_3Dpath('C:\Users\drfarrel\Desktop\sol1.txt',
'C:\Users\drfarrel\Desktop\env1.txt', .025)reading in map of size 15 by 15

Which gives no apparent result other than the printed line I included
above. Since I'm not getting any obvious errors, I'm not sure what's
going
wrong. There are no files generated and placed in MATLAB's directory or
the
Desktop. No new windows, like I would expect for a plot, are displayed.

How can I view the result of this script?


Reply to this email directly or view it on GitHub<
https://github.com/NCSUhardware/high-level/issues/12>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-15241308
.

Awesome, thanks for the quick help @R00ney and @ealamaster. I'll look into getting a copy of MATLAB from NCSU now, to avoid any problems that may have been caused by my rdesktop connection to the VCL machine.