Piecewise function handle
I would like to define a piecewise function handle but I'm not too sure how to do it. Basically something like: fn=@(x) if(x<0) 1 elseif (x>1) 0 else (1/n)(1-x)^((1/n)-1) end where n is a constant. Cheers. ... 1 Apr 2010 22:26
ginput working, but crosshairs and cursor become invisible while selecting
Hello, I'm using ginput when a GUI button is pressed. I set the current figure/axes to where they should be before calling ginput: set(0,'CurrentFigure', thePlot); set( thePlot,'CurrentAxes',theFigure); [deleteX,deleteY] = ginput(1) This works (i.e. I get the right coordinates returned when I c... 9 Apr 2010 01:15
bvpinit for bvp4c
Hopefully this is an easy question, but I'm wanting to initialise my bvp4c solver using the output of a different solver, consequently I have a vector rather than an equation I'd like to use with bvpinit - how am I to do this? I've tried with a basic problem but find that if I simply input the vector I end up with... 5 Apr 2010 20:35
How to read a text (txt) file, modify and save
I am working on creating sample database, EMS Data Generator (a software to create sample data) is too expensive. I tried BULK SQL to insert data into MS SQL database, I failed. I think Matlab can help me but I never did something with reading/modifying file before, I really need help (before making this thread, P... 31 Mar 2010 22:08
How to transfrom a multidimensional Array into a Matrix?
Hi, I have a multidimensional numerical Array A(38,11,188) that I would like to transfrom into a Matrix B(7144,11). Basically what I want to do is concatenate each "page" of the array into one big Matrix. I saw in the help that for structural arrays one can do that easily, but I have no idea how to do it for num... 1 Apr 2010 10:07
Transformation for combining data sets
Hi all! So I have multiple sets of the same type of data. But due to biology.... there is of course some environmental differences between the sets. I have controls for each data set ( or run) that I use as references, but I would like to be able to "tranform" all the data I have ( lets say using the controls to fi... 1 Apr 2010 13:29
Simhydraulics (
I have modelled a simple circuit with a fixed displacement pump filling a gas-charged accumulator. I have set the mechanical and volumetric efficiencies of the pump at 1 to make it ideal. The pump displacement and accumuator capacity is set at its default value but the specific heat ratio is set to 1 for isothermal pro... 31 Mar 2010 18:49
ocean mask
Hi. The Mapping Toolbox examples show a nice way to mask out land (below). How do I mask out the ocean instead? Thanks. load geoid % Create a figure with an Eckert projection. figure axesm eckert4; framem; gridm; axis off % Display the geoid as a texture map. geoshow(geoid, geoidrefvec, 'DisplayType', '... 1 Apr 2010 22:26
Line Intersection given Column Vectors - HELP!
This comes from Introduction to Scientific Computing by Charles Van Loan... I forget the edition, but the question is this: % Implement the following function % function [u,v] = Lines(a,b,c,d) % % a,b,c and d are column n-vectors with the property that for i=1:n, the % lines % % x(t1) = a(i) + t1(b(i) - a(i)... 31 Mar 2010 18:49
AVI write and/or read problem
I am trying to create an AVI file but I am getting some strange errors. I am on Windows 7 with R2010a. My code is the following: aviobj = avifile('example.avi','compression','None'); for i=0:255 aviobj = addframe(aviobj, i*ones(100,100,'uint8')); end aviobj=close(aviobj); clear aviobj readerobj = mmr... 1 Apr 2010 10:07