matlab questions

matlab questions

  • All Sites

0 answers

Convert decimal number to binary in specified range

I wand to convert decimal numbers 0-7 in 3 bits. I have problem with 0, 1, 2 and 3 b = dec2bin(3) b = 11

1 answer

Efficient tree implementation in MATLAB

Tree class in MATLAB I am implementing a tree data structure in MATLAB. Adding new child nodes to the tree, assigning and updating data values related to the nodes are typical operations that I ...

1 answers | 16 mins ago by mikkola on Stack Overflow
2 answers

Object Tracking with Simulink

I am currently utilising the Simulink Hardware Support Package for the RPi to implement an object tracking and pan-tilt algorithm. The issue I am coming up against at the moment is I cannot find a way ...

1 answer

matlab sum over all elements of array valued expression

So I've been wondering about this for a while now. Summing up over some array variable A is as easy as sum(A(:)) % or sum(...sum(sum(A,n),n-2)...,1) % where n is the dimension of A However once it ...

1 answers | 42 mins ago by FirefoxMetzger on Stack Overflow
1 answer

matlab: check which lines of a path are used - graphshortestpath

The related problem comes from the power Grid in Germany. I have a network of substations, which are connected according to the Lines. The shortest way from point A to B was calculated using the ...

1 answers | 52 mins ago by Emma on Stack Overflow
1 answer

Matlab: plot Cubic function for range of y values

I have a cubic equation: roots([9E-10 -2E-06 0.0014 0.039]) I am trying to plot the equation for y values of 0.0 to 0.5 (which I know gives x values in the range of 0 to 700. (i.e. the equation has ...

1 answers | 1 hour ago by 2one on Stack Overflow
0 answers

FOR loop index is too large error

In matlab, I repeatedly encounter this error message. My code does not have large loop number, instead includes a lot of short loop, say for i=1:3 blah blah for y=1:3 for j=1:3 blah blah ...

0 answers

Compressed sensing using matlab

I am trying to implement compressed-sensing technique using matlab to reconstruct an image from fewer measurements. What I've done so far is dividing the image into 8-by-8 blocks, then multiply each ...

0 answers

SIMULINK/dSPACE: Manual start of real-time simulation input data

Good day everyone, I am using a dSPACE interface connected to my test set-up in order to facilitate a real-time working environment. When a model is built and loaded onto the dSPACE module, dSPACE ...

1 answer

Matlab filter cellarray?

I have bellow output of my cellarray. a = {'100.000000', '23.860477', '23.924062', '41.759920', '46.911883', '48.074160'}; I want to filter this array using cellfun function with condition if ...

1 answers | 1 hour ago by AmitTank on Stack Overflow
1 answer

Range-Doppler matrix

I am working on a radar simulation to calculate the range and the Doppler frequency of a target. I would like to build a range-Doppler map or range-Doppler matrix. I do not know the steps to develop ...

1 answers | 1 hour ago by user16612 on Signal Processing
0 answers

Anonymous Function with Sum in Matlab

I want to implement the following function in Matlab for optimization: I know that when defining an anonymous function, I can access the different elements of a vector x using x(1), x(2) and so on. ...

0 answers

load .mat file in simulink from python hdf5storage library

I am trying to load/read some random data in simulink I created using the Python module hdf5storage. I created .mat file in Python (simulink supports version 7.3 only) using this code: # get code on ...

2 answers

Find consecutive values in 3D array

Say I have an array the size 100x150x30, a geographical grid 100x150 with 30 values for each grid point, and want to find consecutive elements along the third dimension with a congruous length of ...

2 answers | 2 hours ago by Kim H on Stack Overflow
0 answers

Matlab - data structure object - variance-covariance

I have a data structure object containing Index prices data. In the structure there are n sub-arrays each representing a security and containing dates and prices. What is the best way to create a ...

0 answers

MATLAB - side-by-side error bars

I have some data and I am plotting the mean at each time point with error bars showing the standard deviation. I can simply use errorbar(x, y, err) and this works fine for a single line. However, if ...

0 answers

Matlab displaying binary images as video

I'm using this code as a starting point to detect the skin color of a hand in a video. as the first step I've manged to do that and display the result by using the imshow(segment); function in Matlab. ...

0 answers

How can i form Bag of words from K-means clustering?

keypoint of hand gesture training images using the SIFT algorithm. The next step is using the vector quantization (VQ) the technique, which clusters the keypoint descriptors in their feature space ...

0 answers

I need to blend two images of different sizes in MATLAB also using Poisson equation

I need to blend two images of different sizes in MATLAB also using Poisson equation. I want to blend the source image (512x512x3) to a specific location (Centre of shirt) in destination image ...

4 answers

None of my MATLAB variables from my function are appearing in my workspace? I don't want them to be output variables

Why aren't any of the varibles from filter_img appearing in my workspace? This would be very helpful to my debugging. I also need to clarify the fact that these variables used to appear on my ...

2 answers

How to run two Simulink models in parallel (in terms of matlab cycle count)? Both models have different configuration parameters

I want to run two simulink model in parallel in such a way that they have same simulation time at any instant. Both model have same fixed step size (Fundamental sample time). Both models have ...

0 answers

Vectrorized Calls of function handles, which are stored in a cell

I would like to know if there is a way to vectorize the calls of different function handles, which are stored in a cell array and have of course input values themselves. I basically have a model, ...

3 hours ago by Ingo on Stack Overflow
0 answers

Mutual information of $ \infty $-PAM

I'm trying to compute using matlab the mutual information for an $ \infty $-PAM input (the limit of a very dense PAM constellation) for a range of snr and I got stuck. I'm working with a real-valued ...

2 answers

Matlab: getting GUI handle value from a callback function when calling by another function

I am new to GUI programming for Matlab, so my question relates to that. Let's say that I create a GUI with GUIDE. In the creation function MyGUI_OpeningFcn(hObject, eventdata, handles, varargin) ...

2 answers | 4 hours ago by user1340654 on Stack Overflow
1 answer

Matlab, define submatrix

I got a 10x10 matrix with a bunch of zeroes and an element of the value 1. I'm trying to create a submatrix with the element of 1 and its surrounding. Problem: This is just an example, the ...

1 answers | 4 hours ago by user3503856 on Stack Overflow
1 answer

parfor Subscript indices must either be real positive integers or logicals

It is my first time use parfor, and I got this error Subscript indices must either be real positive integers or logicals. I can't find what's going wrong? shape = zeros(nFile, 36); parfor i = 1 : ...

1 answers | 4 hours ago by neouyghur on Stack Overflow
2 answers

THREDDS OPeNDAP speed Matlab

Using the following code in Matlab: nc_file_list = {''}; ...

0 answers

How to see the error as a function of iteration steps in eigs()

I am using [Evec,Eval]=eigs(H,1,’sa’) in Matlab to compute the smallest eigenvalue of a sparse matrix H. Can I get the error of the smallest eigenvalue as a function of iteration step?

0 answers

Fit Normal AND Gamma Distribution simultaneously to Data set in MATLAB

Hello dear People of Stackoverflow I need to fit a normal and a gamma distribution to my data set, which is the histogram of local slopes in a stream. The idea is that the normal variations of the ...

0 answers

Multiple drop down menus in one dialog MATLAB

I would like to create a dialog box in Matlab that asks the user several things, so I will have multiple outputs. So far I have found the example code on Mathworks: function choice = choosedialog d ...

15 30 50 per page
1 2 3