f

#### Problem of 'set(gca, 'yscale', 'log')'

I used the following code to plot F.  Everything went well until the last line was executed.  The warning message 'Warning: Negative data ignored' popped up and the image totally went wrong.  I double-checked the values of 'd' and was pretty sure that it was greater than 0.

N = 1000;
t = 3e-9;
d  = 0.0001:0.01:1;
w = logspace(-3, 1, 101)/t;

[D, W] = meshgrid(d, w);
S = sqrt((D.*((2*pi./W).^2+4*(pi*t)^2).^2.*(2*pi*D.*...
((2*pi./W).^4+20*((2*pi./W)*pi*t).^2+64*(pi*t)^4)-(2*pi./W).^2.*((2*pi./W).^2+12*(pi*t)^2).*...
sin(2*pi*D))) ./ ...
(16*N*(2*pi./W).^4*pi.*((2*pi./W).^2+16*(pi*t)^2).*sin(pi*D).^2));
F = S*sqrt(N)/t;

figure(1)
imagesc(d, w*t, log10(F));
set(gca, 'yscale', 'log')

 0
yuxiang (4)
2/17/2010 6:22:05 AM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader.

5 Replies
1015 Views

Similar Articles

[PageSpeed] 37

I did not get the error with what you had here.  It's a pretty picture if you don't change the scale to be logarithmic.  You are getting negative values from your log10(F) call however, which I imagine is causing the warning of negative values (in the color) being ignored.  You could try setting a different color profile as well - maybe jet or hot for example - this won't fix the negative color problem but may be why your results are not looking how you expect.

You could also put in min(1,max(0,log10(F))) to clip your color values to [0,1].

"Yuxiang Lin" <yuxiang@email.arizona.edu> wrote in message <hlg1ud$rof$1@fred.mathworks.com>...
> I used the following code to plot F.  Everything went well until the last line was executed.  The warning message 'Warning: Negative data ignored' popped up and the image totally went wrong.  I double-checked the values of 'd' and was pretty sure that it was greater than 0.
>
>
> N = 1000;
> t = 3e-9;
> d  = 0.0001:0.01:1;
> w = logspace(-3, 1, 101)/t;
>
> [D, W] = meshgrid(d, w);
> S = sqrt((D.*((2*pi./W).^2+4*(pi*t)^2).^2.*(2*pi*D.*...
>     ((2*pi./W).^4+20*((2*pi./W)*pi*t).^2+64*(pi*t)^4)-(2*pi./W).^2.*((2*pi./W).^2+12*(pi*t)^2).*...
>     sin(2*pi*D))) ./ ...
>     (16*N*(2*pi./W).^4*pi.*((2*pi./W).^2+16*(pi*t)^2).*sin(pi*D).^2));
> F = S*sqrt(N)/t;
>
> figure(1)
> imagesc(d, w*t, log10(F));
> set(gca, 'yscale', 'log')

 0
Hyatt
2/23/2011 11:03:07 PM

"Hyatt " <donthaveone@mathworks.com> wrote in message
news:ik43nb$ob7$1@fred.mathworks.com...
> I did not get the error with what you had here.  It's a pretty picture if
> you don't change the scale to be logarithmic.  You are getting negative
> values from your log10(F) call however, which I imagine is causing the
> warning of negative values (in the color) being ignored.  You could try
> setting a different color profile as well - maybe jet or hot for example -
> this won't fix the negative color problem but may be why your results are
> not looking how you expect.

This is not the cause of the problem, I believe.

To the OP:  execute all your code up to but not including the command that
changes the scale to 'log'.  Now look at the limits of your Y axis.

ylim

Remember that IMAGESC, like IMAGE, uses the x and y inputs as the _centers_
of the pixels.  Because the smallest element of w*t is so small, the pixels
corresponding to that coordinate extend into the region of the plane where
the y coordinate is barely negative, and this causes the limits of the axes
to be just slightly negative.  When you set the YScale to be a logarithmic
scale, that slight section of the axes where the Y coordinate is negative
causes this warning.

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com


 0
Steven_Lord
2/24/2011 4:55:29 PM
On Feb 25, 5:55=A0am, "Steven_Lord" <sl...@mathworks.com> wrote:
> "Hyatt " <donthave...@mathworks.com> wrote in message
>
> news:ik43nb$ob7$1@fred.mathworks.com...
>
> > I did not get the error with what you had here. =A0It's a pretty pictur=
e if
> > you don't change the scale to be logarithmic. =A0You are getting negati=
ve
> > values from your log10(F) call however, which I imagine is causing the
> > warning of negative values (in the color) being ignored. =A0You could t=
ry
> > setting a different color profile as well - maybe jet or hot for exampl=
e -
> > this won't fix the negative color problem but may be why your results a=
re
> > not looking how you expect.
>
> This is not the cause of the problem, I believe.
>
> To the OP: =A0execute all your code up to but not including the command t=
hat
> changes the scale to 'log'. =A0Now look at the limits of your Y axis.
>
> ylim
>
> Remember that IMAGESC, like IMAGE, uses the x and y inputs as the _center=
s_
> of the pixels. =A0Because the smallest element of w*t is so small, the pi=
xels
> corresponding to that coordinate extend into the region of the plane wher=
e
> the y coordinate is barely negative, and this causes the limits of the ax=
es
> to be just slightly negative. =A0When you set the YScale to be a logarith=
mic
> scale, that slight section of the axes where the Y coordinate is negative
> causes this warning.
>
> --
> Steve Lord
> sl...@mathworks.com
ks.com

Steven

I disagree with you.
I think the problem is that the OP has log10(F) as his y-axis, then
told Matlab he wants the axis to be logarithmic.  In other words,
Matlab tries to use log10(log10(F)) on the y-axis.
OP can fix the problem by doing this:
imagesc(d, w*t, F);
set(gca, 'yscale', 'log')

or this:
imagesc(d, w*t, log10(F));
ytick=3Dget(gca,'YTick')';
set(gca,...
'YTicklabel',num2str(10.^ytick))

and relabeling the yticks as 10.^yticks

 0
TideMan
2/24/2011 7:20:36 PM

"TideMan" <mulgor@gmail.com> wrote in message
> On Feb 25, 5:55 am, "Steven_Lord" <sl...@mathworks.com> wrote:
>> "Hyatt " <donthave...@mathworks.com> wrote in message
>>
>> news:ik43nb$ob7$1@fred.mathworks.com...
>>
>> > I did not get the error with what you had here.  It's a pretty picture
>> > if
>> > you don't change the scale to be logarithmic.  You are getting negative
>> > values from your log10(F) call however, which I imagine is causing the
>> > warning of negative values (in the color) being ignored.  You could try
>> > setting a different color profile as well - maybe jet or hot for
>> > example -
>> > this won't fix the negative color problem but may be why your results
>> > are
>> > not looking how you expect.
>>
>> This is not the cause of the problem, I believe.
>>
>> To the OP:  execute all your code up to but not including the command
>> that
>> changes the scale to 'log'.  Now look at the limits of your Y axis.
>>
>> ylim
>>
>> Remember that IMAGESC, like IMAGE, uses the x and y inputs as the
>> _centers_
>> of the pixels.  Because the smallest element of w*t is so small, the
>> pixels
>> corresponding to that coordinate extend into the region of the plane
>> where
>> the y coordinate is barely negative, and this causes the limits of the
>> axes
>> to be just slightly negative.  When you set the YScale to be a
>> logarithmic
>> scale, that slight section of the axes where the Y coordinate is negative
>> causes this warning.
>>
>> --
>> Steve Lord
>> sl...@mathworks.com
>> onhttp://www.mathworks.com
>
> Steven
>
> I disagree with you.
> I think the problem is that the OP has log10(F) as his y-axis, then
> told Matlab he wants the axis to be logarithmic.  In other words,
> Matlab tries to use log10(log10(F)) on the y-axis.

I have to disagree with your disagreement.  The exact line of code the user
executes, from the first message I see in this thread, is:

imagesc(d, w*t, log10(F));

From the signature of IMAGESC as given in the documentation:

http://www.mathworks.com/help/techdoc/ref/imagesc.html

"imagesc(x,y,C) displays C as an image and specifies the bounds of the x-
and y-axis with vectors x and y."

log10(F) is the user's image data [the C input].  d controls the x
coordinates of the pixel centers.  w*t controls the y coordinates of the
pixel centers.  It is w*t that has values so small that the extent of the
pixel includes points with negative y coordinates and it is that which
causes the warning.

To check this, let's take the log10(F) out of the picture entirely.

N = 1000;
t = 3e-9;
d  = 0.0001:0.01:1;
w = logspace(-3, 1, 101)/t;

[D, W] = meshgrid(d, w);

% Execute these blocks one at a time.  The first should warn and the second
should not
figure
imagesc(d, w*t, ones(size(D)))
set(gca, 'YScale', 'log') % should warn

figure
imagesc(d, 0.1+w*t, -ones(size(D)))
set(gca, 'YScale', 'log') % should not warn

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com


 0
Steven_Lord
2/24/2011 7:58:32 PM
On Feb 25, 8:58=A0am, "Steven_Lord" <sl...@mathworks.com> wrote:
> "TideMan" <mul...@gmail.com> wrote in message
>
>
>
>
> > On Feb 25, 5:55 am, "Steven_Lord" <sl...@mathworks.com> wrote:
> >> "Hyatt " <donthave...@mathworks.com> wrote in message
>
> >>news:ik43nb$ob7$1@fred.mathworks.com...
>
> >> > I did not get the error with what you had here. =A0It's a pretty pic=
ture
> >> > if
> >> > you don't change the scale to be logarithmic. =A0You are getting neg=
ative
> >> > values from your log10(F) call however, which I imagine is causing t=
he
> >> > warning of negative values (in the color) being ignored. =A0You coul=
d try
> >> > setting a different color profile as well - maybe jet or hot for
> >> > example -
> >> > this won't fix the negative color problem but may be why your result=
s
> >> > are
> >> > not looking how you expect.
>
> >> This is not the cause of the problem, I believe.
>
> >> To the OP: =A0execute all your code up to but not including the comman=
d
> >> that
> >> changes the scale to 'log'. =A0Now look at the limits of your Y axis.
>
> >> ylim
>
> >> Remember that IMAGESC, like IMAGE, uses the x and y inputs as the
> >> _centers_
> >> of the pixels. =A0Because the smallest element of w*t is so small, the
> >> pixels
> >> corresponding to that coordinate extend into the region of the plane
> >> where
> >> the y coordinate is barely negative, and this causes the limits of the
> >> axes
> >> to be just slightly negative. =A0When you set the YScale to be a
> >> logarithmic
> >> scale, that slight section of the axes where the Y coordinate is negat=
ive
> >> causes this warning.
>
> >> --
> >> Steve Lord
> >> sl...@mathworks.com
> >> onhttp://www.mathworks.com
>
> > Steven
>
> > I disagree with you.
> > I think the problem is that the OP has log10(F) as his y-axis, then
> > told Matlab he wants the axis to be logarithmic. =A0In other words,
> > Matlab tries to use log10(log10(F)) on the y-axis.
>
> I have to disagree with your disagreement. =A0The exact line of code the =
user
> executes, from the first message I see in this thread, is:
>
> =A0 =A0 imagesc(d, w*t, log10(F));
>
> From the signature of IMAGESC as given in the documentation:
>
> http://www.mathworks.com/help/techdoc/ref/imagesc.html
>
> "imagesc(x,y,C) displays C as an image and specifies the bounds of the x-
> and y-axis with vectors x and y."
>
> log10(F) is the user's image data [the C input]. =A0d controls the x
> coordinates of the pixel centers. =A0w*t controls the y coordinates of th=
e
> pixel centers. =A0It is w*t that has values so small that the extent of t=
he
> pixel includes points with negative y coordinates and it is that which
> causes the warning.
>
> To check this, let's take the log10(F) out of the picture entirely.
>
> N =3D 1000;
> t =3D 3e-9;
> d =A0=3D 0.0001:0.01:1;
> w =3D logspace(-3, 1, 101)/t;
>
> [D, W] =3D meshgrid(d, w);
>
> % Execute these blocks one at a time. =A0The first should warn and the se=
cond
> should not
> figure
> imagesc(d, w*t, ones(size(D)))
> set(gca, 'YScale', 'log') % should warn
>
> figure
> imagesc(d, 0.1+w*t, -ones(size(D)))
> set(gca, 'YScale', 'log') % should not warn
>
> --
> Steve Lord
> sl...@mathworks.com
ks.com

Aaah.......
You're right.
I don't use image a lot (at all, in fact).

 0
TideMan
2/24/2011 8:09:16 PM

Similar Artilces:

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked form fields. This never works when doing an APPEND/UPDATE query. It can never find the values of linked form fields, Access always asks for the parameter value of the field(s) in question, or Access comes up with an error 3323 - No recordset. I am sure there are other people that have had this problem. What is the difference between Select queries and append/update queries? the append/update queries never seem to be able to find values in linked form fields. Can anyone shed any light on this or point to a knowledgebase Item, or even recommend a book focusing on this subject, I will go and buy it now. I have been for up 2 nights trying to acomplish this and now considering suicide, please help. Thanks In advance, Aaron. I know of two ways you can accomplish this. 1. You can create the SQL script for you append or update query and run the script with DoCmd.RunSQL. 2. You can create a...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ########################################################################### #define MODULE #define __KERNEL__ #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> /* printk */ #include <linux/fs.h> / #include <linux/errno.h> /* error codes */ #include <linux/types.h> /* size_t */ #include <linux/proc_fs.h> /* proc file system */ #include <linux/fcntl.h> #include <asm/system.h> /* cli, flags */ #include <asm/uaccess.h> /* copy from/to user */ /*Registers to get qadc access*/ volatile unsigned short * qadcmcr = (unsigned short *)0x40190000; volatile unsigned short * qacr0 = (unsigned short *)0x4019000a; volatile unsigned short * qacr1 = (unsigned short *)0x4019000c; volatile unsigned short * qacr2 = (unsigned short *)0x4019000e; volatile unsigned short * qasr0 = (unsigned short *)0x40190010; volatile unsigned short * qasr1...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB are ignored -- German edition of comp.lang.ruby FAQ - http://oss.erdfunkstelle.de/ruby/ Aurox Linux - http://qurl.net/7q | http://qurl.net/7r - Firefox Thunderbird - http://qurl.net/7s | http://qurl.net/7t - Liferea Enigmail - http://qurl.net/7u | http://qurl.net/7v - GnuPG [Josef 'Jupp' Schugt <jupp@gmx.de>, 2004-12-10 23.20 CET] > I don't think that this is the intended meaning so what actually *does* > '[OFF]' mean? Off-topic. ...

replacement for '{' and '}' ?
I am still playing around with what kind of syntax I would like to mark up my documents. Are there equivalent long substitutes for { and } when they are not used to describe arguments to functions? Something like \begin{group} and \end{group}. In other words, if I could force myself to write, say, \begin{group} \it ... \end{group} instead of {\it ... }, then I believe I could identify from the markup context what is an argument that belongs to a just invoked macro and what is text. {Of course, in this context, \textit{...} would be better.} No more ambiguity whether a in \myfunction{a} is an argument or just text. Is there a way to make latex barf when it sees an ordinary '{' in text, rather than \begin{group}, but not barf when I want it (to denote macro arguments)? Regards, /iaw On Aug 16, 6:01=A0pm, "ivo...@gmail.com" <ivo...@gmail.com> wrote: > Is there a way to make latex barf when it sees an ordinary '{' in > text, rather than \begin{group}, but not barf when I want it (to > denote macro arguments)? What do you mean exactly? I don't understand. Do you have in mind your- to-be-new-syntax or just regular latex? Cheers, Tomek ivowel@gmail.com wrote: > I am still playing around with what kind of syntax I would like to > mark up my documents. > > Are there equivalent long substitutes for { and } when they are not > used to describe arguments to functions? Something like \begin{group} > and \end{gr...

Like '' & '' & ''
Having this description column in a table "Cookies, peanut butter sandwich, regular" When using this WHERE clause: WHERE (((Food_Data.Description) Like "*Butter*" & "*Peanut*")); I dont get any results, however when using it this way round WHERE (((Food_Data.Description) Like "*Peanut*" & "*Butter*")); I get the row as expected. I assume that the query looks for them in order. Is there a way i can get around this and make the query search for both keywords no matter which order i ype them in. Thanks Dave [posted and mailed] SkunkDave (dave_casserly@totalise.co.uk) writes: > Having this description column in a table > > "Cookies, peanut butter sandwich, regular" > > > When using this WHERE clause: > > WHERE (((Food_Data.Description) Like "*Butter*" & "*Peanut*")); > > I dont get any results, however when using it this way round > > WHERE (((Food_Data.Description) Like "*Peanut*" & "*Butter*")); > > I get the row as expected. > > I assume that the query looks for them in order. The query looks for a string that matches the pattern "*Peanut**Butter*", so obviously it's not going to match "Butter Peanut". As suggested by Harald Albrech this works: WHERE (Food_Data.Description Like "*Butter*" or Food_Data..Description Like "*Peanut...

Return value of 'each', 'current', 'next', 'end'
These array functions: 'each', 'current', 'next', 'end' They return a reference or a value. let's say I want to modify the last value of an array without iterating through all of them. I would do: <? end($array) ; current($array)="new value" ; ?> is that posible?? Thanks. Hermann.Richter@gmail.com wrote: > These array functions: 'each', 'current', 'next', 'end' > > They return a reference or a value. They return values. > let's say I want to modify the last value of an array without iterating > through all of them. > > I would do: > > <? > end($array) ; > current($array)="new value" ; > ?> > > is that posible?? Try end($array);$array[key($array)] = "new value"; Chung Leong wrote: > Hermann.Richter@gmail.com wrote: > > These array functions: 'each', 'current', 'next', 'end' > > > > They return a reference or a value. > > They return values. > > > let's say I want to modify the last value of an array without iterating > > through all of them. > > > > I would do: > > > > <? > > end($array) ; > > current($array)="new value" ; > > ?> > > > > is that posible?? > > Try > > end($array); > $array[key($array)] = "new value"; $array[(sizeof($array...

'icfb' versus 'seultra'/'sedsm'

Re: '^=' and '~='? #5
Sorry, I posted under the wrong subject. My friend asked me to post this, she got an error message in processing the XML file. I don't have much experience in working with XML file. Any help is appreciated! On Thu, Feb 12, 2009 at 10:29 AM, Akshaya Nathilvar < akshaya.nathilvar@gmail.com> wrote: > 32 libname erap 'T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008'; > NOTE: Libref ERAP was successfully assigned as follows: > Engine: V9 > Physical Name: T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008 > 33 options nodate nonumber formdlim='-'; > 34 /* Program: E-RAP Load XML to SAS with map v2.sas*/ > 35 > /************************************************************************* > 36 Update path and file name below. > 37 > **************************************************************************/ > 38 %let data_path = T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December > 2008\Raw XML Data; > 39 %let input_file = 035151_12232008.xml; > 40 > **************************************************************************; > 41 > 42 filename xml_lib "&data_path.\&input_file."; > 43 filename SXLEMAP "&data_path.\xml_map_v2.map"; > 44 libname xml_lib xml xmlmap=SXLEMAP access=READONLY; > NOTE: Libref XML_LIB was successfully assigned as follows: > Engine: XML > Physical Name: XML_LIB &g...

'image' and 'imagesc'
Why is it, that 'image' and 'imagesc' change the y - direction of my data? Or an even more important question, how do I prevent them from doing so? This is the command I use: imagesc(x_vec,y_vec,rez_fld); with: x_vec = 3:0.5:7.5 y_vec = 1:-0.5:-1 rez_fld = size(x_vec) x size(y_vec) greetz, kai Kai: <SNIP wants it upside down... > Why is it, that 'image' and 'imagesc' change the y - > direction of my data... because: that's how you typically look at pics - top/left to bottom/right % now, img=load('clown'); imagesc(img.X); axis image; % -or- % axis ij; disp('change y'); pause; axis xy; % -or- % set(gca,'ydir','normal'); % then disp('get it all right...') pause; imagesc(flipud(img.X)); axis image; axis xy; % for more information help axis; us ...

Re: '^=' and '~='? #9
On Thu, 12 Feb 2009 08:58:21 -0600, Joe Matise <snoopy369@GMAIL.COM> wrote: >Yeah, <> works in PROC SQL, wasn't sure about elsewhere... thanks for >confirmation! Didn't know about the MAX operator, that's interesting. .... hi, In proc SQL, I do get a note saying that: NOTE: The "<>" operator is interpreted as "not equals". In general, i find that we have different sas expressions, mostly identical one another. Still, there remain definite differences among all of these expressions: (1) data step expressions (2) where statement expressions (3) sql-expressions used in proc sql (4) macro expressions this is a less than ideal situation :-) but this may be an inevitable consequence of sas' being around for a long time. cheers, chang ...

'If' or 'Switch' or any ideas
Hello, I am trying to do something that didn't look hard at first, but ended up being a pain in the %$#. Here is my problem. I have three arrays. A={'cc', 'aa', 'gg'} B={'dd', 'ee', 'ff'} C={'bb', 'cc', 'dd', 'ff', 'aa', 'ee'} What I want to do is to see if the items from 'A' and 'B' are found in 'C'. And if so, I need to know which items are. Then, I want to assign a specific value to the items that are present in both arrays, something like if one item or more is found in 'C', assign the value '1', and if one item or more from 'B' is found in 'C', assign the value '2'. So in the end, I would like to have something like that: C={0 1 2 2 1 2}, since 'bb' was not found, 'cc' was found in 'A', 'dd' was found 'B', 'ff' was found 'B', 'aa' was found in 'A', and 'ee' was found in 'B'. I thought about using 'switch', but I don't know how I could 'test' for multiple items at the same time. Any ideas ? Thank you very much in advance for your precious insights, "JS " <jean-sebastien.provost@umontreal.ca> wrote in message news:iu0scc$hra$1@newscl01ah.mathworks.com... > Hello, > > I am trying to do something that didn't look hard at first, but ended up > being a pain i... Re: '^=' and '~='? #7 SAS was originally based on PL/1, and having programmed in PL/1,=20 I'm inclined to use the PL/1 symbol for not equals, which is the ^=3D (actually it is not the caret on IBM mainframes, but the not symbol which looks like L on its side). =20 -Mary ----- Original Message -----=20 From: ./ ADD NAME=3DData _null_;=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Thursday, February 12, 2009 9:09 AM Subject: Re: '^=3D' and '~=3D'? Maybe good reason to use mnemonic equivalents. 882 data _null_; 883 a =3D .v MIN .z; 884 b =3D .v MAX .z; 885 ax =3D .v >< .z; 886 bx =3D .v <> .z; NOTE: The "<>" operator is interpreted as "MAX". 887 c =3D .A NE .A; 888 put (_all_)(=3D);; 889 run; a=3DV b=3DZ ax=3DV bx=3DZ c=3D0 ... Re: '^=' and '~='? #8 32 libname erap 'T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008'; NOTE: Libref ERAP was successfully assigned as follows: Engine: V9 Physical Name: T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008 33 options nodate nonumber formdlim='-'; 34 /* Program: E-RAP Load XML to SAS with map v2.sas*/ 35 /************************************************************************* 36 Update path and file name below. 37 **************************************************************************/ 38 %let data_path = T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008\Raw XML Data; 39 %let input_file = 035151_12232008.xml; 40 **************************************************************************; 41 42 filename xml_lib "&data_path.\&input_file."; 43 filename SXLEMAP "&data_path.\xml_map_v2.map"; 44 libname xml_lib xml xmlmap=SXLEMAP access=READONLY; NOTE: Libref XML_LIB was successfully assigned as follows: Engine: XML Physical Name: XML_LIB 45 libname erap "&data_path"; NOTE: Libref ERAP was successfully assigned as follows: Engine: V9 Physical Name: T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008\Raw XML Data 46 * Read XML file into SAS data set; 47 data erap.Sabino; 48 set xml_lib.E_rap_episode_record; 49 run; ERROR: There is an illegal character in the entity name. encountered during XMLInput pa... getReport(..'hyperlinks','off') I've just noticed folowing tiny bug: getReport(exception,'hyperlinks','off') still adds some links if exception has '.cause'. Example: ================================================== function f1 function fi3() error('error in fi3'); end function fi2() fi3(); end function fi1() try fi2(); catch main_exception exception1 = MException('M:id1','msg1'); exception1=exception1.addCause(main_exception); throw(exception1); end end try fi1 catch exception_ s=getReport(exception_, 'extended', 'hyperlinks', 'off') ; id=fopen('1.txt','w+'); fprintf(id,'%s',s); end end ================================================== Result: ---------------------------------------------------------------------------------------------------- Error using ==> f1>fi1 at 21 msg1 Error in ==> f1 at 32 fi1 Caused by: Error using ==> <a href="matlab: opentoline('f:\Igor\Documents\MATLAB\Test_projects\getReport\f1.m',5,0)">f1>fi3 at 5</a> error in fi3 ---------------------------------------------------------------------------------------------------- ... Re: '^=' and '~='? #2 No difference that I know of ... SAS has all sorts of things you can use as operators. LT,< LE,<= ne, ^=, ~=, <> in some contexts at least eq, = <<< these actually DO have a difference or two, particularly as relates to assignment I don't recall where the full list is, but http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000202951.htm#a000290128has the list of them usable in WHERE statements (which, IIRC, is slightly greater than that of normal code, as it allows for SQL syntax in ways the rest of SAS does not). -Joe On Wed, Feb 11, 2009 at 4:52 PM, Duck-Hye Yang <dyang@chapinhall.org> wrote: > Hello, > What is the difference between '^=' and '~='? > > Thanks, > Duckhye > ... Formating numbers: I want '9' to be '009' and '19' to be '019' How can I do this ? This is the number used in invoice. Thanks. formatInvoiceNo: Format([InvoiceNo],"000000000") Open the report (form?) in design view, and set the Format property of this text box to: 000 -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "swingingming" <ming.mge@gmail.com> wrote in message news:1123566670.327279.83700@f14g2000cwb.googlegroups.com... > How can I do this ? This is the number used in invoice. > Thanks. Thanks. I will stay with your solution. It works fine. Because the invoice number actually consists of other Texts. ... (patch for Bash) 'vcat', 'vset', 'vfile' These 3 builtin commands are designed to "dump" and "reload" shell variables to/from file, without going through another layer of interpretation or parsing. In addition to reading/writing simple string for ordinary shell variable, the commands can handle positional parameters and array variables (both index and values). vcat [-0A] [name] > file Writes a shell variable NAME to stdout (inverse of 'vset'). If NAME is missing, then positional parameters are printed. Each value of array elements and positional parameters is terminated by '\0', whereas ordinary shell variable is not \0-terminated unless option -0 is given. By default, only the array values are printed, but option -A will print the array index as well. vset [-0A] [name] < file Assigns a shell variable NAME from stdin (inverse of 'vcat'). If NAME is missing, then positional parameters are set. If input data contains '\0', then it is considered array, and NAME will be converted to array variable. By default, only array values are set, but option -A will set the array index as well. If there is only one string with trailing '\0', then option -0 will set it to regular shell variable. vfile -[rw] [-d dir] [-0A] name... Read (-r) or write (-w) shell variables from/to files of the same name. Internally, it uses 'vcat' and 'vset', so full array content is preserved. vcat [-0A] name > name vset [... Scilab's 'optim' and 'splin' I've got this really cool application that makes a smoothed line using splines, then fits it to a source line using a nonlinear weighting. I'm currently using SciLab with it's 'optim' and 'splin' function to do this, but now I need to write some embeddable C++ code. The 'splin' function is obvious -- it generates a spline from a number of inflection points. The 'optim' function as I am using it uses a quasi-Newton method, which is working just fine for me. Before I go and write this stuff up by hand, does anyone have any suggestions on where I can find example code to do this? I'm mostly concerned with the optimization -- I'd like to get my hands on something where some one else has already fallen into the pitfalls. TIA. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html Just a remark : there is a lsq_splin function which try to fit a splin to discrete points (with various weight if needed). May be it can help you at least to find a good starting point for your optimization ? hth Bruno Tim Wescott wrote: > I've got this really cool application that makes a smoothed line using > splines, then fits it to a source line using a nonlinear weighting. Is it important that you u... problem with 'include' and 'file_exists' function i encountered this problem: "include('inc.php')" will work problely but "include('./inc.php') doesn't work .. both file_exists('inc.php') or file_exists('./inc.php') didn't return the right value.this always show "file doesn't exists' my environment is win2003+iis+php5 how to fix it ? sorry to my English thanks to you. :) > "include('inc.php')" will work problely >but "include('./inc.php') doesn't work .. There are plenty of situations where this will happen. If a file name begins with ./, it will be looked up with include_path relative only to the current working directory, not the current script. Are you SURE you know what the current working directory is when the script is started? >both file_exists('inc.php') or file_exists('./inc.php') didn't return >the right value.this always show "file doesn't exists' include() uses include_path to search for files. file_exists() doesn't. >my environment is win2003+iis+php5 > >how to fix it ? The fix may be to correct the "right" value. Don't think that! "Gordon Burditt =D0=B4=B5=C0=A3=BA " thanks for your answer. > > There are plenty of situations where this will happen. If a file > name begins with ./, it will be looked up with include_path relative > only to the current working directory, not the current script. >... 'more' fails, but 'vi' works?? 'more <fileName>' does not show anything in the file. It exits immediately without showing the contents. But, I can do 'vi'. The 'ls -l <fileName>' also shows 80 bytes as the size and all the permission bits are set. 'file <fileName>' shows <fileName>: commands text What is the reason why the 'more <fileName>' fails? In article <1171696623.532022.125720@t69g2000cwt.googlegroups.com>, <qazmlp1209@rediffmail.com> wrote: >'more <fileName>' does not show anything in the file. It exits >immediately without showing the contents. >But, I can do 'vi'. The 'ls -l <fileName>' also shows 80 bytes as the >size and all the permission bits are set. > >'file <fileName>' shows ><fileName>: commands text > >What is the reason why the 'more <fileName>' fails? Maybe you have "more" aliased to ":". On 2007-02-17, qazmlp1209@rediffmail.com <qazmlp1209@rediffmail.com> wrote: > 'more <fileName>' does not show anything in the file. It exits > immediately without showing the contents. > But, I can do 'vi'. The 'ls -l <fileName>' also shows 80 bytes as the > size and all the permission bits are set. Many mores will exit immediately if the file is less than a screenful, which will probably be the case with an 80 byte file. As for why no... 'DrawCopy' in Clarion6 'ClaApi' I try to use the SVGraph Class in Clarion 5.5. Every thing looks fine, but DrawCopy() function doesn't work, So I cannot save picture and print out. I cannot find DrawCopy() function in clarion5.5 runtime lib. How can I link DrawCopy() function into clarion5.5 project? Or I have to write this function by myself? Is there someone can help me? Thanks a lot Jerry ... Increment with '#' and decrement with 'b' Although I've had a lot of practice writing Perl I often feel that I'm not really a Perl programmer because the finer points of Perl style -- the things that really make Perl what it is -- aren't in the front of my mind. I would like help with a simple task which, try though I might, still looks really laborious the way I've written it. I'm turning a standard musical notation for a note into a pitch. The note "A" will be zero, and the other notes on the piano, black and white, will range from 1 (for B flat/A sharp) up to 11 (for A flat/G sharp). A "b" suffix reduces the pitch by 1; "bb" by two. Going the other way, a "#" suffix increases by 1 and "##" by two. So D is pitch 5, Dbb is 3. Equally D## would be 7. So I need to match the following strings to the pitches shown 0 A, Bbb, G## 1 A#, Bb 2 A##, B, Cb ... and so on I can write code lots of ways to do this, but it has no style: it looks like over-cooked potato dumplings, and there's little point in my posting it here. I can extract the basic pitch of the note reasonably elegantly with a hash, like this my %pitches = ( A=>0, B=>2, C=>3, D=>5 ... etc), followed by my$this_pitch = $pitches{$this_letter }; But every time I try to allow for the accidentals I end up with tedious "if" statements, or multiple increments/decrements like this $self->{pitch}-- if (lc$acc) eq 'b'; ...

Web resources about - Problem of 'set(gca, 'yscale', 'log')' - comp.soft-sys.matlab

Resources last updated: 3/30/2016 11:25:14 PM