matlab

What is the best way to store a 16 × (2^20) matrix in matlab?

I am thinking of writing the data to a file. Does anyone have an example of how to write a big amount of data to a file? edit 1: Most elements in the matrix are zeroes, others are uint32. I guess the simplest save() and load() would work, as @Jonas suggested. ...

how to set MATLABPATH in Python and using mlabwrap?

I tried to use mlab.path(path,'/my/path') but failed. Got NameError: name 'path' is not defined in python. Anyone has an idea? ...

Why i get this following error when using dir in Matlab?

Matlab keep give me following error message : ??? Error using ==> dir Argument must contain a string. Error in ==> Awal at 15 x = dir(subDirs) Below is my codes : %MY PROGRAM clear all; clc; close all; %-----Create Database----- TrainDB = uigetdir('','Select Database Directory'); TrainFiles = dir(TrainDB); dirIndex = [TrainFile...

Y-axis in MATLAB bar plot is hidden.

I am drawing a simple bar diagram in MATLAB. The problem is, that the value at x = 0 lets the y-axis disappear partially. Is there a way to bring the y-axis to the front instead of hiding between the y-value for x=0? Is there any option I can make sure the y-axis is always in the front? ...

Brackets at the start of input in matlab ?? [ x , y ] = ....

Hello, I would like to know what is the use of having inputs in brackets like this : [fx, fxx] = differentiate(...) why is fx and fxx in square brackets ? Another example includes this [y,t,ysd] = step(m) Please explain ! Thanks ...

Using GUIDE with object-oriented MATLAB?

I have an object-oriented MATLAB app that needs a GUI, and I'd like to use GUIDE for the layout (at least). I've tried the manual way, and doing the control positioning is just too painful. I've noticed that GUIDE is very much procedurally-oriented; it generates M-files that assume they are run from the path and aren't associated with a...

How to capture an output from a function in MATLAB?

I have a simple function function increase(percent, number) low = number - number*percent; end I want to return low so I can use it as an argument for another function mitoGen(asp, arg, increase(0.2, 234), glu) Is there a way to do this? ...

Calculate posterior distribution of unknown mis-classification with PRTools in MATLAB

I'm using the PRTools MATLAB library to train some classifiers, generating test data and testing the classifiers. I have the following details: N: Total # of test examples k: # of mis-classification for each classifier and class I want to do: Calculate and plot Bayesian posterior distributions of the unknown probabilities of mis...

MATLAB Mex files

Is there a way to get the mex file for a built-in MATLAB m- file? If yes, how? If no, does that mean I have to write the C code myself (oh nooo!!!) ...

Running just the matlab editor

Is there a way to just run the matlab (7.9.0) editor and not the rest of the "desktop" on linux? ...

Tool to diagonalize large matrices

I want to compute a diffusion kernel, which involves taking exp(b*A) where A is a large matrix. In order to play with values of b, I'd like to diagonalize A (so that exp(A) runs quickly). My matrix is about 25k x 25k, but is very sparse - only about 60k values are non-zero. Matlab's "eigs" function runs of out memory, as does octave's ...

Matlab and .net problem with character string function input

I have a MATLAB function that I've compiled into a .net library. The function is a simple one that takes a character array as an input and a numeric array as output: function insert = money(dateLimit) .. insert = [1 2]; The function works fine when no function arguments are specified (a default argument is provided inside the function)...

Comparison of images with matlab

hey I want to compare two images using matlab and display a message 'it is the same image' or.'sorry , it's not the same image' My program always displays 'it is the same image'. Mycode is: i1=imread('001_1_1.fig'); i2=imread('001_1_1.fig'); x1=edge(i1,'canny'); j1=imcrop(x1,[135 90 100 95]); x2=edge(i2,'canny'); g=0; xxx=1; yyy=1; ...

How do I maintain rows when sorting a matrix in MATLAB?

I have a 2-by-3 matrix, and I want to sort it according to the first column. Here's an example: data will change to --> new data 11 33 10 22 22 44 11 33 10 22 22 44 I have this code for sorting a matrix A but it doesn't work well: sort(A,1,'ascend'); ...

routine to either evaluate code or transmit via udp

I have a set of code that, depending on how the program is initiated, will either be executed locally or sent to a remote machine for execution. The ideal way I imagine this could work would look something like the following: line_of_code = 'do_something_or_other();'; if execute_remotely send_via_udp(line_of_code); else eval(li...

How do I display a file or directory browser dialog using MATLAB

I have created a blank GUI and now I want to program a push button to display a file or directory browser dialog. ...

"Snap an image" in MATLAB

Does MATLAB have a function that will "snap an image" or move an image to some predefined location if within a certain area? ...

Assign a value to a static text in GUI MATLAB

hi, how to Assign a value to a static text in GUI MATLAB. ...

Dispalay image using GUI MATLAB in a specific region

Hi, I'm looking for how can I display an image in my GUI in a specific region of my interface. ...

Problem when calling local variable in GUI MATLAB

I'm getting this error: Error in ==> APP>pushbutton2_Callback at 109 img=imread(FileName) When I try to use FileName in pushbutton2_Callback I'm getting the error mentioned FileName is variable in pushbutton1_Callback. ...