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:
Shortcuts and links in windows

Subject: Shortcuts and links in windows

From: Adam

Date: 16 Jan, 2009 10:36:01

Message: 1 of 3

Hiya, I just had to move onto a windows platform at short notice. How do I get MATLAB to read via links on the windows system?

i.e.,

load C:\MRI\carrot_stick\data.mat

works fine but if I make a link (shortcut) in the windows file browser called carrot_stick under the MRI directory, then MATLAB only reads the link as a file. Is there a way to set up links within MATLAB to bypass this behaviour of windows?

Many thanks for any suggestions,

Adam

Subject: Shortcuts and links in windows

From: Jiro Doke

Date: 16 Jan, 2009 13:59:02

Message: 2 of 3

"Adam" <a.mcnamara@surrey.ac.uk> wrote in message <gkpnuh$dpm$1@fred.mathworks.com>...
> Hiya, I just had to move onto a windows platform at short notice. How do I get MATLAB to read via links on the windows system?
>
> i.e.,
>
> load C:\MRI\carrot_stick\data.mat
>
> works fine but if I make a link (shortcut) in the windows file browser called carrot_stick under the MRI directory, then MATLAB only reads the link as a file. Is there a way to set up links within MATLAB to bypass this behaviour of windows?
>
> Many thanks for any suggestions,
>
> Adam

Adam,

You can use Java inside MATLAB.

On Windows, shortcuts should have an extension .lnk

>> x = java.io.File('C:\MRI\carrot_stick.lnk')
>> y = sun.awt.shell.ShellFolder.getShellFolder(x)
>> actualDirectoryName = y.getLinkLocation()
>> load(fullfile(char(actualDirectoryName), 'data.mat'))

jiro

Subject: Shortcuts and links in windows

From: Adam

Date: 16 Jan, 2009 14:22:02

Message: 3 of 3

perfect, cheers

Adam

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