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:
two matlab questions from a beginner

Subject: two matlab questions from a beginner

From: Rance

Date: 23 Jun, 2008 04:04:27

Message: 1 of 3

Hello

I appreciate any help that someone could offer!
I'm sure there is a simple fix to my problem(s).

I am using the uigetfile function to load in a .txt file. Following a few operations I would like to save a new variable with the filename obtained with the uigetfile function but add a small extension to the name.

Currently I open the file - [filename, pathname, filterindex] = uigetfile('*.txt', 'Pick file');

I do a few things to the file I select. Now have a new matrix (lets call it A). I would like to save this file as the filename obtained from the uigetfile function plus a (-A) or (-new) appended to it.

My second question is as follows:
I have a large column of data and I would like to evaluate when the data becomes less than a predetermined value(this I can do).

The second part of this requires the data to be less than the predetermined value, however I would like to specify that there has to be, for example, 3 consecutive data points greater than the predetermined value, for it to 'count' or be considered for further analysis.

I apologize it I should not have posted these questions here.

Thanks for any help

Subject: two matlab questions from a beginner

From: Titus

Date: 23 Jun, 2008 07:15:54

Message: 2 of 3


"Rance" <holmes.mike@gmail.com> schrieb im Newsbeitrag
news:6053174.1214193898136.JavaMail.jakarta@nitrogen.mathforum.org...
> Hello
>
> I appreciate any help that someone could offer!
> I'm sure there is a simple fix to my problem(s).
>
> I am using the uigetfile function to load in a .txt file. Following a few
> operations I would like to save a new variable with the filename obtained
> with the uigetfile function but add a small extension to the name.
>
> Currently I open the file - [filename, pathname, filterindex] =
> uigetfile('*.txt', 'Pick file');
>
> I do a few things to the file I select. Now have a new matrix (lets call
> it A). I would like to save this file as the filename obtained from the
> uigetfile function plus a (-A) or (-new) appended to it.
>
> My second question is as follows:
> I have a large column of data and I would like to evaluate when the data
> becomes less than a predetermined value(this I can do).
>
> The second part of this requires the data to be less than the
> predetermined value, however I would like to specify that there has to be,
> for example, 3 consecutive data points greater than the predetermined
> value, for it to 'count' or be considered for further analysis.
>
> I apologize it I should not have posted these questions here.
>
> Thanks for any help


Hi Rance,

I'll got for the easier question (the first one) ;-):
use the functional form of save: save([filename '_A'], A)

Titus

Subject: two matlab questions from a beginner

From: Rance

Date: 23 Jun, 2008 13:32:00

Message: 3 of 3

Thanks a lot! Turns out I was on the right track with this, just had some typos.

I appreciate the help!

Tags for this Thread

No tags are associated with 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