comp.softsys.matlab
  Home FAQ Contact Sign in
comp.softsys.matlab only
 
Advanced search
June 2010
mo tu we th fr sa su w
 123456 22
78910111213 23
14151617181920 24
21222324252627 25
282930     26
2010
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2010 2008 2007  
total
comp.softsys.matlab Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: solving a system of COUPLED partial differential equations         


Author: Alina Stoian
Date: Jun 8, 2010 12:59

Torsten Hennig wrote in message <1639689742.292475.1275920746356.JavaMail.root@gallium.mathforum.org>...
>> Torsten Hennig wrote
>> in message
>> <735098493.260351.1275405399232.JavaMail.root@gallium.
>> mathforum.org>...
>>>> "Hello,
>>>>
>>>> I'm trying to solve a system of 3 partial
>>>> differential equations (3 diffusion equations,
>> 2nd
>>>> law of Fick) using ode15s! First of all, I
>>>> transformed my system in an ODE system using the
>>>> finite difference method to discretize each
>> equation.
>>>> After, I attached the boundary conditions , that
>>>> after the discretization are become algebraic
>>>> equations , and so in the end I' m obliged to
>> solve a
>>>> DAE system. From my readings I understood that I
>> have ...
Show full article (5.48Kb)
no comments
  Re: uitable         


Author: Philip
Date: Jun 8, 2010 12:55

"asir Dass" gmail.com> wrote in message fred.mathworks.com>...
> hi,
> I had created a table in matlab GUI which is editable and i am able to add new row to the table by pressing a key, how ever when i generate a new row all the coloumns format changes to numeric and i am not able to enter any string/character into the newly added row.
> whenever i try to add character to the new row it displays a messaage NaN and does not accept the character. I am struggling with this problem for over a week now. Please help me if anybodu of you know the answer
> Thanks.

After speaking the the Mathworks, the problem is the format of the cell entries that you added. This is you want the cell table enrtires of the new row to be blank strings.

The table here: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uitableproperties.html#brglhyc
explains what will happen based on the data TYPE of the cell array and the requested column FORMAT for the uitable. (The table is at the bottom of the ColumnFormat entry, just above the ColumnName entry).

Hope this helps
no comments
  Re: 3-dimensionnal array         


Author: Aniouska Conchon
Date: Jun 8, 2010 12:55

Thank you.
no comments
  Re: Set interestions/Searching in large Matrices         


Author: Anthony Hopf
Date: Jun 8, 2010 12:47

Bruno,

I hate to rehash this, but the code I am using now is inefficient (and you mentioned that this would be a more effective way to bin my data). I have a 3d matrix or values indexed by r,theta,phi (each are 3d matrices). I would like to bin this 3d value matrix conditioned on the three other matrices (r, theta, and phi). On the matrix r I would like to collect the index values binned by a binning vector:

r_edge = -(binsize/2):binsize:(N*binsize)-(binsize/2);

can I do this with histc? It looks like I need to reshape the 3d matrix r into a vector to do the binning with histc (or maybe I don't and I just don't understand the indexing in matlab, if I reshape does matlab remember the old index values that will correspond to the 3d value matrix?)

I will then bin on theta and phi:

theta_edge = -(tbin/2):tbin:(M*tbin)-(tbin/2);
phi_edge = -(pbin/2):pbin:(P*pbin)-(pbin/2);

in this case I was that I would use your procedure with histcn, but again it looks like I need to reshape my theta and phi 3d matrices and don't want to lose the corresponding index values.

I'm not trying to be laze ( i just feel like I should "stand on the shoulders of giants" by accessing your understanding of these functions)

Thank you,

Anthony

"Bruno Luong" wrote in message fred.mathworks.com>...
> "Anthony Hopf" gmail.com> wrote in message fred.mathworks.com>...
>> "Bruno...
Show full article (2.81Kb)
no comments
  SimPowerSystems sources         


Author: monica
Date: Jun 8, 2010 12:45

Hello!

Can you please tell me what data type I need for the elements in the SimPowerSystems. I'm trying to connect a source (from simulink/sources) and none gets connected. The same is valid for a signal from wrokspace. I can only use the elements with the sources given in SimPowerSystems?

Thanks a lot!
no comments
  imwrite         


Author: Aydos R
Date: Jun 8, 2010 12:38

hi there,
I have a dataset including "jpg" files...

data/
model 1.jpg
model 2.jpg
.
.
model 30.jpg

and I would like to read all the images by using "imread" function...
but instead of coding like ;

img1=imread('./data/model 1.jpg');
img2=imread('./data/model 2.jpg');
.
.
img30=imread('./data/model 30.jpg');

I would like to do it by "for" cycle...for example;

for i=1:30
img(i)=imread('./data/model (i).jpg');
end
Show full article (0.94Kb)
1 Comment
  int16 to float conversion..help         


Author: Sai
Date: Jun 8, 2010 12:32

Im reading data from serial port as int16 class but i could not convert it into float using any of the functions float,cast,typecast. They say that int to float is not supported. somebody plz tell me how can i do typecasting from int16/uint16 to float/double???

Thnx
no comments
  sets of subsets generated by 'permpos.m' --- looping?         


Author: Hans-Friedrich
Date: Jun 8, 2010 12:28

Hi there,

perhaps, someone can sort me out?

Assume you have a set of J objects, and you want to generate all possible (permuted) subsets of size j = 2, ..., J-1 selected from the set of J objects (the subsets should at least contain 2 objects, and the set containing all J objects is trivial) --- I used the "permpos.m" function (downloadable at http://www.mathworks.com/matlabcentral/fileexchange/11216-permpos). For example, for j = 2, we obtain

1 1 0 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0
...
0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 1 1

(where 0 = object is disregarded; 1 = object is in the subset), with a total of 45 different (permuted) subsets for j=2.

Now, for J=10, the number of all possible (permuted) subsets for j = 2, ..., J-1 equals 1012, which can be collected into a binary matrix, say M (i.e., each row represents a specific permuted subset).

On each specific subset (i.e., row of M) the same operations are performed (mostly vectorized --- hence, number of 1's in a given row of M should not --- and, as it looks, does not --- make a difference). MATLAB processed all sets in M within the proverbial "blink of an eye".

Larger J (e.g., 40 plus) cause a memory problem. So, I decided to "chop up" the problem and loop the generation of subsets such that for each j a specific M is generated (followed by said operations performed on each row of M).

To my utmost surprise, when I compared the CPU times for the two versions of the algorithm for the same J=10, the "chopped-up" version took almost 20 minutes (multiply/divide by X, depending on the machine you're using). I'm absolutely clueless about this immense increase in CPU time. Any suggestions, hints, etc. would be greatly appreciated!

Cheers,

Hans-Friedrich Koehn
no comments
  Re: extract finite difference jacobian from fsolve routine         


Author: Paul Kerr-Delworth
Date: Jun 8, 2010 12:27

"derek " che.utexas.edu> wrote in message fred.mathworks.com>...
> (version R2009b)
>
> I've written program where I am solving a PDE such that for every timestep I am solving a system of nonlinear equations F(X) = 0 with 100+ degrees of freedom. I can use fsolve for it, but I find that all the algorithms built into fsolve have trouble converging for one reason or another. However, if I write a simple routine that does just basic Newton's method I find it works much better. This would be fine, but to use Newton's method I either need to calculate the actual Jacobian (I'd rather avoid that if possible as it would be very tedious), or I can use a finite difference approximation of the Jacobain. This is very slow though, since if I have N degrees of freedom, I need N evaluations of the function F(X) in order to estimate the Jacobian.
>
> In the fsolve function, when you use the trust-region-reflective algorithm, you can pass in a JacobPattern sparse matrix that has the pattern for the Jacobian so that it can more quickly compute the finite difference approximation of the Jacobian. Is there a way I could extract this part of fsolve so that I can more quickly get the finite difference Jacobain estimate for my own solver?
>
> Looking through the code for fsolve, starting on line 355 for the trust-region-reflective algorithm it has the following code:
>
> %% Execute algorithm
> if algorithmflag == 1 %% trust-region reflective
> if ~gradflag
> Jstr = optimget(options,'JacobPattern',defaultopt,'fast');
> if ischar(Jstr)
> %% options.JacobPattern is the default: 'sparse(ones(jrows,jcols))'
> Jstr = sparse(ones(Jrows,Jcols));
> end
> checkoptionsize('JacobPattern', size(Jstr), Jcols, Jrows);
> else
> Jstr = []; ...
Show full article (3.16Kb)
no comments
  Instrument Control Toolbox: Data Transmition problem         


Author: Wei He
Date: Jun 8, 2010 12:05

Hola,
Friends!
I am a rookie in this work, I hope I could have the honor to get some help from you. Thanks in advance!
I need to collect tens of thousands of power traces from Osci, and transmitted them to matlab to make some statistical analysis.
In previous work I just use the pen driver to gather the traces, collecting such a large amount of data is really time-consuming.
So , I plan to make the transmittion automatically. I am rightnow USB to connect Agilent Osci to my PC. The connection is OK. However when I type the fscanf instruction, timeout always occures.

x=visa('agilent','USB0::0x0957::0x1733::MY48260142::INSTR');
fopen(x);
get(x,'status')
A=fscanf(x,'%%c',5000)

The following messsage always jump out:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Warning: VISA: A timeout occurred
A =
''
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Can you help me to find the problem?
no comments
1 2 3 4 5 6 7 8 9