matlab

Why do I receive a "Out of Windows Resources" warning when I open numerous figure windows in MATLAB [7.0 (R14) and beyond] on a Microsoft Windows PC?

My screen resolution is set to 1600x1200. In MATLAB, I set my "DefaultFigurePosition" property using the following command: set(0,'DefaultFigurePosition', [400 100 1050 1000]) I then open multiple figure windows using the following loop: for i = 1:46 figure end On the last figure, I receive the following message in the command...

How do I choose computer hardware which best optimizes the performance of MATLAB?

For example: I would like to know what the minimum specification are for RAM I would like to know which processor is best I would like to know what system is best, UNIX, Windows? ...

Modeling and Simulation Programming Language

I work with many different models and simulations. Some of the older models and simulations are written in FORTRAN. Some of those models have been converted to C++, but the current trend is to create these models using MATLAB/SIMULINK. From a computer science perspective I have always felt MATLAB/SIMULINK was not a good solution. Wha...

How to save data in a 32 bit binary file in matlab?

I have to test some "random numbers" generatied by a program in matlab, with diehard. it accept only 32 bit binary file, while if i save my data in matlab, they are saved in binary file with double precision (so 2*64=128 bit binary file). how can i take a 32 bit binary file in matlab, working on a 64 bit system? ...

How do I make a window move to the top of other windows in Gnome when that window already has the focus?

I have an application that sends the focus to other windows but those windows then don't automatically display themselves in the foreground, i.e. on top of all the other windows. Where can I configure the preferences of my window manager so that this is the default behaviour? In particular I'm using the Ctrl-0 and Ctrl-Shft-0 shortcuts ...

connection of MATLAB 7.0 and MYSQL

I want to connect MATLAB with MYSQL.I dont know the procedure.In MATLAB help it says about some drivers which confuses me alot.Can someone please guide me!please tell me the complete process.I shall be very very thankful!!! ...

How do I plot to an image and save result without displaying it, in matlab

Hi, This question kind of starts where this question ends up. Matlab has a powerful and flexible image display system which lets you use the imshow and plot commands to display complex images and then save the result. For example: im = imread('image.tif'); f = figure, imshow(im, 'Border', 'tight'); rectangle('Position', [100, 100, 10,...

Displaying analytical results in a MATLAB GUI

My problem is this: I have a MATLAB GUI and I want the analytical results I get if I run it to appear in my GUI and not the command window. I tried using a listbox to display the results because of the slider bars that are automatically created for the listbox, but it did not work. How can I display the data, perhaps using a static text ...

MATLAB FREAD/FWRITE

I want to change the value of a couple of bytes in a large binary file using matlab's fwrite command. What I am trying to do is open the file using fopen(filename,'r+',precision) then read down the file using fread(fid,NUM,'int32') (this all works). Once I get to the file position where I want to write (overwrite) the values of the nex...

Can I embed the Simulink interface in a MATLAB GUI?

I would to display the Simulink workspace in a MATLAB GUI window. This is cosmetic as I know well that Simulink operates fine without this addition. However, I have no idea how to have a space in a GUI where the Simulink workspace can be displayed. Effectively, the GUI would form a thick frame around the Simulink workspace. Please le...

Map function in MATLAB?

I'm a little surprised that MATLAB doesn't have a Map function, so I hacked one together myself since it's something I can't live without. Is there a better version out there? Is there a somewhat-standard functional programming library for MATLAB out there that I'm missing? function results = map(f,list) % why doesn't MATLAB have a Ma...

How to update a MATLAB GUI in the background?

I have a MATLAB GUI and a separate application that writes data to a file. I'd like my MATLAB GUI to check the file periodically, and update the GUI when it changes. In Java, I'd use a SwingUtils.Timer(sp?) object to do something like this. Does MATLAB have timer functionality? I could write a java class and do it I suppose, but want ...

How can I hook into MATLAB to evaluate symbolic derivatives from C code?

How can I use MATLAB's Symbolic Toolkit to symbolically evaluate derivatives from C or C++? ...

How do you draw different surfaces with the same color scale in MATLAB?

I'm trying to represent several surface plots* for which the scale differs a bit. Each surface plot is drawn in a separate subplot and/or figure. Right now, I'm using the default color mapping, which automatically scales the whole range of the color map to my figure, i.e. the maximum of my surface is always red (in 'jet' color mode) reg...

Am I using histc wrong, or is this MATLAB's fault?

Ok, here's some code in MATLAB: data = [1 1.5 2 3 4 4.5 5 6 7 7 7 0 0 0]; histc(data, [1:1:5]) histc(data, [1:1:5, inf]) histc(data, [-inf, 1:1:5]) which outputs the following: ans = 2 1 1 2 1 ans = 2 1 1 2 5 0 ans = 3 2 1 1 2 1 My question is, why does MATLAB return a useles...

Curve fitting unsorted points on a plane

Question: How do you fit a curve to points on a plane if they aren't single valued? For the example shown, how would one fit a curve (like the black one) to the noisy blue data? It's similar to spline smoothing, but I don't know the order of the data. Matlab would be preferred, but pseudocode is fine. Or a pointer to what the correc...

How can I create a triangular matrix based on a vector, in MATLAB?

Let's say I've got a vector like this one: A = [101:105] Which is really: [ 101, 102, 103, 104, 105 ] And I'd like to use only vector/matrix functions and operators to produces the matrix: 101 102 103 104 105 102 103 104 105 0 103 104 105 0 0 104 105 0 0 0 105 0 0 0 0 or the following matrix: 101 102 103 104 105 0 ...

User defined functions in MATLAB

I need to write a function to imread an image and convert it to grayscale. Is this correct: function trial() O = imread('m1.png'); G = rgb2gray(O); imwrite(G,'s','jpg'); end or is there a better way to write it? ...

Array division- translating from MATLAB to Python

I have this line of code in MATLAB, written by someone else: c=a.'/b I need to translate it into Python. a, b, and c are all arrays. The dimensions that I am currently using to test the code are: a: 18x1, b: 25x18, ...

How to pass parameters from C# to MATLAB?

I want to pass an image file name as a parameter from C# to MATLAB. Here's what I have so far: MATLAB code function out = trial(im) O = imread(im); G = rgb2gray(O); imwrite(G,'output','jpeg'); out = G; C# code private void btn_Browse_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); if (openFileDialog...