https://in.mathworks.com/matlabcentral/newsreader/most_recent_feed
MATLAB Central Newsreader Recent Posts
Most Recent Posts
enus
©19942017 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
https://in.mathworks.com/images/membrane_icon.gif

Fri, 24 Mar 2017 23:04:03 +0000
Re: wavedec2 and NaN values
https://in.mathworks.com/matlabcentral/newsreader/view_thread/344699#952633
Bino A Varghese
"M Falco" wrote in message <nb9drm$gjk$1@newscl01ah.mathworks.com>...<br>
> Hello everyone, I am trying to use the wavelet decomposition toolbox (particularly I'm decomposing with wavedec2 and reconstructing with wrcoef2) but I'm having problems as my matrix have some NaN values that really affect my results. Is there a way to ignore those NaN values?<br>
> <br>
> Hope someone can answer and thank you very much,<br>
> <br>
> Magui<br>
<br>
Do you have a solution to this problem?

Fri, 24 Mar 2017 21:20:03 +0000
Re: Error loading Java class
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347947#952632
M Laymon
"Yair Altman" wrote in message <ob2eiv$73v$1@newscl01ah.mathworks.com>...<br>
> "M Laymon" wrote in message <ob24at$ee1$1@newscl01ah.mathworks.com>...<br>
> > I have a Java class to facilitate interacting with an Oracle db from Matlab. When I try to load the Java object from a complex Matlab application where one script calls another using the command<br>
> > dbUtil = com.ge.MatlabDBUtil();<br>
> > I get the error:<br>
> > Undefined variable "com" or class "com.ge.MatlabDBUtil".<br>
> > I wrote a simple test script where the command<br>
> > dbUtil = com.ge.MatlabDBUtil();<br>
> > works fine. I am using javaaddpath to make sure the jar file is visible to Matlab. If I call javaclasspth('dynamic') right before calling "dbUtil = com.ge.MatlabDBUtil();", the jar containing MatlabDBUtil.class is on the classpath. I found a post from 2011 suggesting that when using 'javaaddpath' you also need to use 'clear java;' but I get the same error using 'clear java;'. Initially when running my simple test, I was getting an error about the jar for ojdbc not being found, so I am using javaaddpath to add the jar for ojdbc to the java classpath as well. Any suggestions on how to debug the difference between the two use cases ? Thanks.<br>
> <br>
> <br>
> The following article lists potential reasons for this:<br>
> <a href="http://UndocumentedMatlab.com/blog/javaclassaccesspitfalls">http://UndocumentedMatlab.com/blog/javaclassaccesspitfalls</a><br>
> <br>
> Yair Altman <br>
> <a href="http://UndocumentedMatlab.com">http://UndocumentedMatlab.com</a> <br>
> <br>
Thanks for the link. I was able to find the problem based on it. It was a Java version issue. In the case that worked, I was not explicitly loading my .jar with javaaddpath. (This is an old test code someone else wrote. Since it worked, I did not notice it was not loading my jar explicitly.) I had to use javaaddpath to load the JDBC jar, so I thought I would need to add the jar for my code as well. When I removed the javaaddpath command for the jar from the code that did not work, it started working. The version of Matlab I am using uses Java 1.6. I recently recompiled my Java class and built the jar file using Java 1.7. When I don't explicitly load my jar with javaaddpath, the directory containing the .class files is still included on the classpath. Since the jar file contains the same .class file, I don't know why the raw .class file works but using a jar containing it <br>
does not, but for now I can at least run the code. Thanks.

Fri, 24 Mar 2017 20:41:03 +0000
PDEToolbox 3D question and problem: Assigning holes inside geometry and meshing failed with a Hmax of ...
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347956#952631
Peter Fimognari
I have been attempting to set up a 3D PDE problem and have been running into a problem with generateMesh and a question about importGeometry.<br>
<br>
I can import a .STL file fine, my model consists of 4 cells and 41 faces. The four cells are (1) a shaped piece of iron which is in contact with a pair of bar magnets (2) and (3), all within a bounding box (4). Each of these seems to be reasonably recognized by importGeometry.<br>
<br>
My question about importGeometry is: I would like to treat cells (2) and (3) as holes in the model so I can assign boundary conditions on their edges. Is this possible? <br>
<br>
My problem with generateMesh is: I am unable to generate a mesh of this geometry. It seems that the contact between cell (1) and (2) and (3), and the bounding box (4) all prevent the creation of the mesh. If I generate each individual cell as its own STL model I can mesh them, but it seems there is no way to combine these into a single model. <br>
<br>
Has anyone else come across this? Thanks in advance.

Fri, 24 Mar 2017 19:52:03 +0000
Re: how to limit the axis for mesh/surf plots
https://in.mathworks.com/matlabcentral/newsreader/view_thread/33666#952630
Brando Miranda
salinas_cristian@hotmail.com (Cristian) wrote in message <10edf71c.0204081051.1fc84e11@posting.google.com>...<br>
> You can always use the "set" command to modify the limits separatly.<br>
> <br>
> example:<br>
> <br>
> set(gca,'xlim',[10 20]) or . . .<br>
> set(gca,'ylim',[20 30]) or . . .<br>
> set(gca,'zlim',[30 35]) or . . .<br>
> set(gca,'xlim',[10 20],'ylim',[20 30],'zlim',[30 35])<br>
> <br>
> gca is the handle to the current axes<br>
> <br>
> bye and good luck<br>
<br>
what is gca and how do I get access to it?

Fri, 24 Mar 2017 19:37:03 +0000
Re: Error using save
https://in.mathworks.com/matlabcentral/newsreader/view_thread/346365#952629
unami
"Paul Nel" <paul.nel@aurecongroup.com> wrote in message <nt4sg7$d7h$1@newscl01ah.mathworks.com>...<br>
> I have the following code<br>
> <br>
> %%<br>
> file_dir = 'C:\Users\';<br>
> <br>
> %Save variables<br>
> datestamp=string(datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss'));<br>
> file_name=strcat(file_dir,'sps_',datestamp,'.mat');<br>
> save(file_name);<br>
> %%<br>
> <br>
> But I get: <br>
> <br>
> Error using save<br>
> Argument must contain a character vector.<br>
> <br>
> error?<br>
> <br>
> Paul<br>
<br>
The function strcat returns a string, which is a different data type from a character vector. You just need to convert it. Change<br>
<br>
file_name=strcat(file_dir,'sps_',datestamp,'.mat');<br>
<br>
to <br>
<br>
file_name=char(strcat(file_dir,'sps_',datestamp,'.mat'));

Fri, 24 Mar 2017 19:36:03 +0000
Re: Error using save
https://in.mathworks.com/matlabcentral/newsreader/view_thread/346365#952628
unami
"Paul Nel" <paul.nel@aurecongroup.com> wrote in message <nt4sg7$d7h$1@newscl01ah.mathworks.com>...<br>
> I have the following code<br>
> <br>
> %%<br>
> file_dir = 'C:\Users\';<br>
> <br>
> %Save variables<br>
> datestamp=string(datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss'));<br>
> file_name=strcat(file_dir,'sps_',datestamp,'.mat');<br>
> save(file_name);<br>
> %%<br>
> <br>
> But I get: <br>
> <br>
> Error using save<br>
> Argument must contain a character vector.<br>
> <br>
> error?<br>
> <br>
> Paul<br>
<br>
The function strcat returns a string, which is a different data type from a character vector. You just need to convert it. Change<br>
<br>
file_name=strcat(file_dir,'sps_',datestamp,'.mat');<br>
<br>
to <br>
<br>
file_name=char(strcat(file_dir,'sps_',datestamp,'.mat'));

Fri, 24 Mar 2017 18:50:03 +0000
Re: display in between numbers
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347955#952627
Georgios
"joshua thompson" wrote in message <ob3oov$bi8$1@newscl01ah.mathworks.com>...<br>
> how do i display either all 4 or all 8 numbers evenly between 1100<br>
<br>
Look at the help for the linspace command.<br>
<br>
linspace(1,100,4)<br>
linspace(1,100,8)<br>
<br>
The first one will return a set of integers, while the second one will return floats.<br>
<br>
Regards,<br>
Georgios

Fri, 24 Mar 2017 18:33:04 +0000
display in between numbers
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347955#952626
joshua thompson
how do i display either all 4 or all 8 numbers evenly between 1100

Fri, 24 Mar 2017 17:05:02 +0000
Re: Find position of number in matrix
https://in.mathworks.com/matlabcentral/newsreader/view_thread/287571#952625
dpb
On 03/24/2017 12:02 PM, Robert Berghaus wrote:<br>
..<br>
<br>
> I modified your version, as that one did not work for me. Just enter the<br>
> value you are looking for and name your matrix or array m.<br>
><br>
> s=size(m);<br>
> for i=1:s(1)<br>
> for j=1:s(2)<br>
> if m(i,j) == <your value><br>
> pos=[i j]<br>
> end<br>
> end<br>
> end<br>
<br>
Use the vector/array, Luke!<br>
<br>
[i j]=find(m==value);<br>
<br>
As the other poster says, see<br>
<br>
doc find % for details<br>
<br>


Fri, 24 Mar 2017 17:02:03 +0000
Re: Find position of number in matrix
https://in.mathworks.com/matlabcentral/newsreader/view_thread/287571#952624
Robert Berghaus
"Nic Roberts" wrote in message <i2f9jb$26a$1@fred.mathworks.com>...<br>
> Thanks Jan, wasnt aware of this.<br>
> <br>
> Nic<br>
> <br>
> "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <i2c424$ich$1@fred.mathworks.com>...<br>
> > Dear Nic,<br>
> > <br>
> > > s=size(m)<br>
> > > for i:s(1)<br>
> > > for j:s(2)<br>
> > > if m(i,j) = <your value><br>
> > > pos=[i j];<br>
> > > end<br>
> > > end<br>
> > > end<br>
> > <br>
> > Take a look at the command FIND.<br>
> > Jan<br>
<br>
<br>
I modified your version, as that one did not work for me. Just enter the value you are looking for and name your matrix or array m.<br>
<br>
s=size(m);<br>
for i=1:s(1)<br>
for j=1:s(2)<br>
if m(i,j) == <your value><br>
pos=[i j]<br>
end<br>
end<br>
end

Fri, 24 Mar 2017 16:14:03 +0000
Re: How to load DLL and Lib files into Matlab
https://in.mathworks.com/matlabcentral/newsreader/view_thread/336354#952623
Blake Rankin
I am attempting load a DLL that was generated from Fortran 90 source code. Using the source code, I wrote a corresponding header file. After implementing loadlibrary, I receive the following error:<br>
<br>
Error using loadlibrary<br>
There was an error loading the library<br>
The specified procedure could not be found.<br>
<br>
Caused by:<br>
Error using loaddefinedlibrary<br>
The specified procedure could not be found. <br>
<br>
Note that I ran a dependency analysis on the DLL and have all libraries installed on my machine. In addition, I am able to load and call a library containing a simple function (e.g. multiple two scalars). <br>
<br>
Do you have any insight as to the source of the above error message? In my header file, I am declaring all arguments by pointer. Could this be the problem?<br>
<br>
Thank you,<br>
Blake

Fri, 24 Mar 2017 16:07:03 +0000
AODV routing protocol in MANET
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347954#952622
ram gupta
i am a pg student my thesis topic is 'aodv routing in MANET' if any one has matlab code related to this topic pls send me,.

Fri, 24 Mar 2017 15:44:03 +0000
Re: Integrating DAE system with piecewise defined terms
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347953#952621
Francesco Ardia
ok, but this will make the code specific for this forcing terms.<br>
<br>
In order to keep the code more general, so that I can change how loads act in time (in the function where all the equations are written) without adjusting the limits of integration of multiple ode solvers (in the main), I adopted this solution:<br>
<br>
I brought tolerance's limits from 1e4 to 1e3, and ode15s managed to integrate across the if discontinuity, provided that the change in the forcing term was smooth.

Fri, 24 Mar 2017 14:18:03 +0000
Re: Integrating DAE system with piecewise defined terms
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347953#952620
Torsten
"Francesco Ardia" wrote in message <ob35rb$sh5$1@newscl01ah.mathworks.com>...<br>
> Hi everyone!<br>
> <br>
> I'm solving a system of equations, algebraic and differential, to simulate a car's planar motion.<br>
> Everything's fine with constant forcing terms (except for some initial fluctuations of very low intensity over the very first integration step).<br>
> <br>
> When I define forcing quantities (eg torque) with an if condition on time, the command ode15s starts solving, but stops as t no longer respects the first if condition, displaying:<br>
> <br>
> "Unable to meet integration tolerances without reducing the step size<br>
> below the smallest value allowed (7.105427e15) at time t."<br>
> <br>
> Plots show that some quantities begin to fluctuate right before the if condition is no longer met.<br>
> <br>
> Is there a way to overcome this without calling ode15s multiple times (one for each "time region" defined by the if condition)?<br>
> <br>
> Thanks<br>
<br>
Restarting the integrator for each time region is exactly the way to go in case that the model equations Change at specified times. <br>
<br>
Best wishes<br>
Torsten.

Fri, 24 Mar 2017 13:56:57 +0000
Re: matlab code for routing protocols
https://in.mathworks.com/matlabcentral/newsreader/view_thread/347242#952619
geethapriya237@gmail.com
On Thursday, January 5, 2017 at 9:08:07 PM UTC8, kapila sharma wrote:<br>
> can anyone please provide me the full source codes for AODV, DSR, and DSDV routing protocols along with plotted graphs, so that I can further extend it by using optimization techniques.<br>
<br>
did u got source code for aodv protocol