matlab

trading system in MATLAB

I am trying to write a program which will find the total # of pips (price gained) with a strategy. Basically, the strategy is whenever the stock price is 5, and we will start trading and we will continue trading as long as the stock price is higher than 2 and lower than 9, meaning in the range (2,9). When the price hits 2 or 9, we stop ...

how do you enter a nonlcon in MATLAB?

How do you enter a nonlcon into MATLAB's fmincon function. I can't seem to find a good example of the syntax. ...

Estimate value of Pi using MATLAB

I don't know from where should I start solving this problem. It seems that the Math department at UGA once again dropped the ball , and forgot the value of pi. You are to write a function called mypi which consumes a number that specifies the required accuracy and approximates the value of pi to that accuracy. You are going to the foll...

how to open a matlab p-code file

Does anybody know how I can see the code of a matlab p-code file? ...

Generating combinations in Matlab

I use combnk to generate a list of combinations. How can I generate a subset of combinations, which always includes particular values. For example, for combnk(1:10, 2) I only need combinations which contain 3 and/or 5. Is there a quick way to do this? ...

how to add multiple functions in matlab

Hi everyone, I want to add several functions from a single .m file. Is this possible without actually having to create an individual m file for each function? ...

MATLAB: how to calculate the 'determinant' of a matrix N*N in MATLAB

A(N,N): matrix First, i want to give the matrix from my keyboard. Then calculate the determinant of A Thanks! ...

Rotating a 3-d matrix in Matlab

I have a 3-d matrix with the following dimensions 6-2-10. I want the row dimension to switch places with the heigh dimension, ie 10-2-6. Reshape doesn't achieve this the way I want. How can this be done? Can I rotate the matrix? ...

MATLAB: Checking type of table

I want to ask how to check if a variable is table 1x8 or 8x1 of type logical? I know I can check the class of an array for logical like this: strcmp(class(a),'logical') I know I can get the size of table like this: [h w] = size(a); if(w==1 & h==8 | w==8 & h==1) But what if table has more than 2 dimensions? How can I get number of d...

How to get all columns smaller than a threshold?

I have a row-vector with arbitrary values. I am interested in the column IDs of the columns which contain a value <= a specified threshold the number of columns which lie below the threshold. Is there a more elegant way to compute this in MATLAB than using a for-loop? ...

Has any one detcted any other object then face etc

I have done face detection using some demo files and some harr cascades that found in emgu CV sample files but what should i do to train my program to detect other things like phones or bucket or any other object. So far i have googled and found that i have to do some haartraning for that i need some 800 negative samples and 2000 positi...

Check if field exists in Matlab struct without loading it

I have a large struct in a .mat file. I want to check if a specific field is present in the struct without loading the .mat file. The .mat files are very large and I want to minimize memory use. Can I do this or must I use the I load it like this? Suppose the .mat file is called "test.mat" with struct s in it: load('test.mat') tf = i...

Random number analysis.

Given a series of randomly generated data how can I figure out how random it actually is? Is R-lang a good tool for this matlab? What other questions can can these tools answer about randomly generated data? Is there another tool better for this? ...

extracting data from an existing matrix

Hello, I have a matrix containing 4320 entries for example: P=[ 26 29 31 33 35 26 29 ..........25] I want to create 180 matrices and every matrix contains 24 entries,i.e the 1st matrix contains the 1st 24 entries the 2nd matrix contains the 2nd 24 entries and so on I know a simple method but it will take a long time which is: P1=...

resize images and keep them with new size in new folder in matlab

Hi I write the following code in matlab. from this code I take sequence of images as input from a folder and resize these images. Now I need to store them with new size on output folder. any one help me to update this code. fileFolder = fullfile('D:','Texture DataBases','images3000'); dirOutput = dir(fullfile(fileFolder,'image*.jpg'...

Where can i find a link to download Matlab MCR 7.10?

Where can i find a link to download Matlab MCR 7.10? ...

Matlab: is there a way to speed up computing the sign of a number?

The bottleneck in my program is computing the sign of a number for all numbers in an array, when the array size is very large. I show the two approaches I've tried below, both with similar results. I have 16GB of RAM, and the array occupies ~5GB. The problem I'm seeing is the sign function takes up a lot of RAM+virtual memory. Anyone kno...

how to combine two images on one window matlab?

i have two images of size lets say image1=250x250 and image2=250x550. i want to have an image that shows these two images combine. like image3=image1+image2 means image3=250x800. ...

MATLAB Matrix Sum using Nested For

I am trying to find the sum of the following matrix in matlab [1 1 1 1; 1 2 1 2; 4 5 3 2; 1 3 2 4; 10 11 1 1; 90 9 2 1] I am trying to do so using a nested for statement yet i keep getting errors. please help Must use nested for My code: A = [1 1 1 1; 1 2 1 2; 4 5 3 2; 1 3 2 4; 10 11 1 1; 90 9 2 1]; for j=1:4, for i=1:6, sum = ...

Difficulty in creating filename

Hey guys. I have some difficulty in creating a filename. okay, here is what I want to do: a matlab function called file_save(filename,input_data) is to save data into a xml file. so in a for loop, I want to create xml file with sequential filename eg. output1.xml output2.xml output3.xml I guess there are some way of combining filename? ...