matlab

memory not freed in matlab?

I am running a script that animates a plot (simulation of a water flow). After a while, I kill the loop by doing ctrl-c. After doing this several times I get the error: ??? Error: Out of memory. And after I start receiving that error, every call to my script will generate it. Now, it happens before anything inside the function that I...

I have a having a a matrix index bounds in matlab

I keep getting the error( this is in Matlab) Attempted to access r(0,0); index must be a positive integer or logical. Error in ==> Romberg at 15 I ran it with Romberg(1.3, 2.19,8) I think the problem is the statment is not logical because I made it positive and still got the same error. anyone got some ideas of what i could do? func...

MATLAB interview questions?

I programmed in MATLAB for many years, but switched to using R exclusively in the past few years so I'm a little out of practice. I'm interviewing a candidate today who describes himself as a MATLAB expert. What MATLAB interview questions should I ask? Some other sites with resources for this: "Matlab interview questions" on Wilmo...

This is more a matlab/math brain teaser than a question

Here is the setup. No assumptions for the values I am using. n=2; % dimension of vectors x and (square) matrix P r=2; % number of x vectors and P matrices x1 = [3;5] x2 = [9;6] x = cat(2,x1,x2) P1 = [6,11;15,-1] P2 = [2,21;-2,3] P(:,1)=P1(:) P(:,2)=P2(:) modePr = [-.4;16] TransPr=[5.9,0.1;20.2,-4.8] pred_modePr = TransPr'*modePr MixPr...

Automatic camera calibration

From Wikipedia, camera resectioning is the process of finding the true parameters of the camera that produced a given photograph or video. Camera resectioning is also known as geometric camera calibration. Currently I am using Camera Calibration Toolbox for Matlab for my camera calibration. The toolbox returns calibration parameters suc...

What is the best way to flag some elements in MATLAB? using NaN or Inf? or something else?

As you may know, in many occasions, there is a need to flag some elements of a matrix. For example when we have weighted adjacency matrix, and our graph is not fully connected, we have to flag some elements to show that there is no edge between those nodes. The question is how to do that? Is it better to put NaN or Inf on that elements ...

Does opencv have a function similar to size and bwperim in matlab?

I am new to opencv and good at matlab i want to write equalent of below to opencv [mm,nn]=size(binaryimage); bwperim(binaryimage); Please can any one help ...

Free SCM for Matlab 64 bit version on Windows

When Matlab is installed in its 64 bit version, it can use only 64 bit source control systems. Is there a source control system that's free, works with 64 bit Matlab and runs on Windows? It can be a system that supports only one developer. It can be 32 bit itself, if it'll work. It will be installed on the same machine as the Matlab in ...

Resizing panels in GUIs without changing size of the contents (MATLAB)

Hi, Does anyone know how to change the size of a panel in the gui editor (guide) without changing the size of the contents? At the moment, if I change the size of the panel, I have to spend three times as long changing the size of the contents, and its a real pain. Thanks James ...

Updating GUI axes in MATLAB

I am making a GUI for a program I have created, where I need to be able to change the position of a load along a beam. I have set up the axes and the slider properly, but I am unsure how to get the axes to update, as I can't find any examples that show how to do this on the internet. At present, as I move the load, the position updates...

running python code in matlab?

hi,i have some python code(some functions) and i want to implement this in bigger matlab program!how can i do this?any help will be useful.... ...

How can I tell if a rectangular matrix has duplicate rows in Matlab?

I have a rectangular n x m matrix (n != m). What's the best way to find out if there are any duplicate rows in it in Matlab? What's the best way to find the indices of the duplicates? ...

How to preallocate an array of class in MATLAB?

I have an array of objects in MATLAB and I've called their constructors in a loop: antsNumber = 5; for counter = 1: antsNumber ant(counter) = TAnt(source, target); end MATLAB warns me to use preallocation to speed up the process. I do know the benefits of preallocation but I don't know how to do that for objects. ...

I need to order a list that is dependant on another list. how to change both lists?

I have a Matlab program that generates a list x = 6.1692 8.1863 5.8092 8.2754 6.0891 the program also outputs another list aspl = 680 637 669 599 693. The two lists are on equal length and the first element in list x is related to the first element in list aspl. I need to graph the two lists but want list aspl ...

How to clear persistent variables while keeping breakpoints in MATLAB?

Is there a way to clear all persistent variables in MATLAB functions, while keeping the breakpoints in the corresponding function files? clear all; and clear functions; both kill the breakpoints. ...

Saving/Associating slider values with a pop-up menu

Hi, Following on from a question I posted yesterday about GUIs, I have another problem I've been working with. This question related to calculating the bending moment on a beam under different loading conditions. On the GUI I have developed so far, I have a number of sliders (which now work properly) and a pop-up menu which defines th...

Different weights of false positive and false negative in neural network?

I have a yes/no classification problem, where false positives are worse than false negatives. Is there a way to implement this fact into neural network especially in MATLAB's Neural Network Toolbox? ...

half-sine pulse shaping

hi, i wanted to know what is the pulse shape of the modem.oqpskmod? and if it is not half-sine pulse shape, how is it possible to make it half-sine pulse shape as it is stated in ieee 802.15.4(zigbee) standard where it shows it as follows p(t)=sin(pi*t/2*Tc) if 0<=t<=2Tc p(t)=0 if otherwise ? thanks a lot! ...

Generating lognormally distributed random number from mean, coeff of variation

Most functions for generating lognormally distributed random numbers take the mean and standard deviation of the associated normal distribution as parameters. My problem is that I only know the mean and the coefficient of variation of the lognormal distribution. It is reasonably straight forward to derive the parameters I need for the ...

How do I call Matlab in a script on Windows?

I'm working on a project that uses several languages: SQL for querying a database Perl/Ruby for quick-and-dirty processing of the data from the database and some other bookkeeping Matlab for matrix-oriented computations Various statistics languages (SAS/R/SPSS) for processing the Matlab output Each language fits its niche well and we...