matlab

modem.oqpskmod -> modem.oqpskdemod not same result

hi, i am trying to simulate the IEEE 802.15.4/ZigBEE PHY,... chip_values = [ 1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,0; 1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0; 0,0,1,0,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,0,1,0; 0,0,1,0,0,0,1,0,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0...

What is the fastest way to unzip textfiles in Matlab during a function?

Hello all, I would like to scan text of textfiles in Matlab with the textscan function. Before I can open the textfile with fid = fopen('C:\path'), I need to unzip the files first. The files have the extension: *.gz There are thousands of files which I need to analyze and high performance is important. I have two ideas: (1) Use an ex...

How do i add a mclmcrrt.lib or (.lib) file when compiling with g++ Compiler

I have a algorithm code which uses matlab library(mclmcrrt.lib) it compiles well in my vc++ compiler when i add that library to it. My question is if i want to compile it on Linux g++ compiler how should i link the library can i use it? ...

calculate array element persistence algorithm

I have a large array 15x15x2200. THis is merely a collection of 15x15 sparse matrices depicting the links between 15 nodes and how they vary over 2200 time units. I need to calculate for how much time does each link persist. By this I mean, suppose A[4,11] is 0 till time unit 5 and stays 1 till time unit 20 and then becomes 0 and again b...

Interpolating 2d data that is piecewise constant on faces

I have an irregular mesh which is described by two variables - a faces array that stores the indices of the vertices that constitute each face, and a verts array that stores the coordinates of each vertex. I also have a function that is assumed to be piecewise constant over each face, and it is stored in the form of an array of values pe...

checking if function is a part of/which toolbox

We have a relatively "rich" matlab installed on our workstations. I now need to send some code to ..., and I'd like to check what toolboxes it requires for it to work properly. What would be the easiest way to do that ? How does one find out what toolbox some function belongs to ? ...

compute only diagonals in matrix product in octave

Is there a way in octave to compute and store only the diagonal of a matrix product? Basically like doing vector = diag(A*B); I don't care about any of the values of A*B except those on the diagonal. The matrix to around 80k x 12 and 12 x 80k. So even if I didn't care about the speed/extra memory it simply wont fit in RAM. Strange, ...

How can you draw a bezier curve in Matlab

What's the Matlab way to draw a Bezier curve ? Do you have to prgoram it yourself ? I am not looking for a user made routine, but am asking if Matlab offers a standard way to draw them. ...

Prevent "MATLAB" folder in My Documents

I have Matlab (2009b, Windows 7) set up to start in a special folder where I keep all my Matlab files and a startup script. This folder is not in "My Documents" Still, Matlab creates an empty folder called "MATLAB" in "My Documents" every time it is started. This is very annoying since this change propagates to other computers which sha...

Porting MATLAB 7 files back to 6.1

I have a MATLAB assignment due in an hour, and I wrote it all in MATLAB 7. One of my friends who took the assignment said that it is not working on MATLAB 6.1 as functions like dirac are not defined. I only just found out that the MATLAB version used for evaluation is 6.1, and I have no idea how to fix my code. Can anyone help by pointin...

Alternate method to kron

I'm doing CDMA spreading in MATLAB. And I'm having an Out of Memory error in MATLAB despite upgrading my RAM, preallocating arrays, etc. Is there an alternate method to kron (Kronecker tensor product) in MATLAB? Here is my code: tempData = kron( Data, walsh); Data is a M by 1 matrix and walsh (spread code) is a 8 by 1 matrix. My Da...

MATLAB - load file whose filename is stored in a string

I am using MATLAB to process data from files. I am writing a program that takes input from the user and then locates the particular files in the directory graphing them. Files are named: {name}U{rate} {name} is a string representing the name of the computer. {rate} is a number. Here is my code: %# get user to input name and rate N...

MATLAB - use a string to set the title of a graph

I'm writing a MATLAB program that reads in a title from the user to set on a graph... t = input('Please enter a title for the graph: ', 's'); I then want to set the title of my plot to t. I can't seem to get it to work... title(t) %# returns ??? Index exceeds matrix dimensions. Many thanks for the help! ...

Regression in Matlab assuming Student's t Distributed Error Terms

I see that it is possible to use regress/regstats for OLS, and I found an online implementation of L1-Regression (Laplace), but I can't quite seem to figure out how to implement t distributed error terms. I have tried maximizing the log-likelihood of the residuals, but don't seem to be coming up with the right answer. classdef student ...

MATLAB - printing graph with different output names

Hey all, I have a MATLAB program that graphs some things and then outputs the graph to a file. If I run this program several times in the same directory, the file gets overwritten each time. How can I make it so the filename it outputs to changes... I currently have this: print -depsc myfigure I have strings, rate and name, that I wa...

Malloc a 3-Dimensional array in C?

Hey all, I'm translating some MATLAB code into C and the script I'm converting makes heavy use of 3D arrays with 10*100*300 complex entries. The size of the array also depends on the sensor's input, ideally the array should be allocated dynamically. So far I've tried two approaches the first being a flat 1D array along the lines of va...

how best to loop through an array taking into account of the index in matlab?

Hi all, I've seen this thread talking about map: http://stackoverflow.com/questions/983163/map-function-in-matlab As a result, I was wondering whether there are similar ways to do it taking into consideration of the indices. Such as if i want to do something like (x_i)^i. thanks a lot! ...

how to apply a function to every row in matlab?

Hi all, you can apply function to every item in a vector by saying v .+ 1, or you can use arrayfun, any one have any suggestions on how to do it for every row/column of a matrix without using for loop? thank you very much! Jason ...

how do you do symbolic differentiation on function handle?

Hi all, Say if i define the following: g = @(x) x/sqrt(x^2+1) How do i get the derivative function for g, which i can then use to evaluate at different points? I tried the symbolic math toolkit, and tried the following: >> syms x >> f = x/sqrt(x^2+1) f = x/(x^2 + 1)^(1/2) >> diff(f) ans = 1/(x^2 + 1)^(1/2) - x^2/(x^2 + 1)^(3/...

In MATLAB, How I can run multiple files .m (M-file) automatically?

In MATLAB, how I can run 20 files .m (M-file) automatically? ...