1 answer

cannot pass a literal constant in Matlab Coder

I'm using Matlab Coder to generate C++ code. It gives an error at the last line in the shown code: function [Xs Ys]=sc(X, Y, r) ... xGauss=gausswin(2*r+1,5)); It would be fine if it's something ...

1 answers | 19 mins ago by Z Cao on Stack Overflow stackoverflow.com
0 answers

is Matlab computer vision camera-1 the right-hand camera from perspective of behind or in front?

Matlab's programming guide states that stereo camera-1 is the right-hand camera, and cam-2 is left-hand. But it does not define if right-hand means in front of the stereo cameras (perspective of ...

1 answer

Connecting 3 points on a 3d matrix

I have 3 points on a 3D matrix and I want to connect them. So far, I can create a line going from 1 point to another, but I want to essentially create a triangle connecting 3 of the points. Here's ...

1 answers | 43 mins ago by Taimoor Khan on Stack Overflow stackoverflow.com
1 answer

Call subclass static method from inside superclass static method

I have a large set of small, related classes linked together by an interface class. All classes implement a static method, which retrieves and processes data specific to the class. The output of ...

0 answers

One function for multiple pushbuttons in matlab

I was thinking of setting one function for multiple pushbuttons, They all do the same thing, but it has a different defining value. This is so that when one pushbutton is activated it does not get ...

0 answers

Matlab/R: Restructure data in R which was imported from Matlab

I have created a small dataset in matlab which looks like this and can be downloaded for a reproducible example here: https://www.dropbox.com/s/e2qssxd5pu0x6hn/TEST_DATA.mat?dl=0 What I would like ...

0 answers

Efficiently Setting up Sparse Matrices in MATLAB for Matrix Inversion

Consider the following weighted solution to the normal equation for a least squares inverse problem: m = inv(G'W'WG) G'W'Wd I would like to set up the weighting matrix W, which is a square diagonal ...

2 answers

Extending the size of an image by padding the borders with 1s

I want to extend the size my image using MATLAB. For example, I have an image of 397x450 I want to make it into 600x600 where I place the original image in the middle, but all of the new elements ...

2 answers | 1 hour ago by Joker on Stack Overflow stackoverflow.com
0 answers

Convert white part of a log-spiral image to scatter plot using MATLAB

I'm new to MATLAB, and this is the problem I'm facing. I have many spiral RGBimage like a galaxy, cyclone, bisected conch, etc., and I'm trying to fit a log-spiral on to it. However, the accuracy of ...

0 answers

Flow field around cylinder in Matlab

I'm pretty new to different plots in Matlab and I'm trying to write a code that will show the flow field around a cylinder in Matlab. I'm at the very start and first of all I want to just make the ...

1 answer

degtorad vs deg2rad in MATLAB?

Is there a difference between degtorad and deg2rad in MATLAB? Is there a benefit of one over the other, like speed (or some other metric I didn't think of)? ...

3 answers

Read JSON objects with Matlab

I want to read from a json file with Matlab and store everything in "data" as objects. After import, I need to iterate through all and extract specific values, if it's available in the object. JSON ...

3 answers | 1 hour ago by Kevin on Stack Overflow stackoverflow.com
0 answers

How can I change the power of the numbers in axis of the plotted figure?

I want to plot z=(x,y) in which x and y are arrays with large numbers (for example, 6.3251e8). Matlab just changes the power of the numbers in the figure(for example 0.63251e9). I want the numbers of ...

1 answer

Would it be more efficient to switch to a different ODE solver?

Warning, I'm not certain if this question belongs on here or Math Stack Exchange. It's primarily a question of performance, but it heavily involves a differential equation solver. Anyway, in Matlab, ...

2 answers

Removing non-matching dates from two time series in matlab

I have two time series x and y which roughly cover the same period of time. The data is in daily form however there are some days that have data in one dataset but no data in the other. I wish to use ...

2 answers | 2 hours ago by BazD on Stack Overflow stackoverflow.com
4 answers

How can I find all the cells that have the same values in a multi-dimensional array in octave / matlab

How can I find all the cells that have the same values in a multi-dimensional array? I can get it partially to work with result=A(:,:,1)==A(:,:,2) but I'm not sure how to also include A(:,:,3) I ...

5 answers

How to combine matrix of different size in a cell array into a matrix in MATLAB

Similarly to How to combine vectors of different length in a cell array into matrix in MATLAB I would like to combine matrix having different dimension, stored in a cell array, into a matrix having ...

1 answer

updating a function in MATLAB

The code below works. You can copy-paste this code in case you don't understand what I ask below. In my gui, I have a pushbutton, popupmenu and edittext. Pushbutton enables adding new strings to ...

1 answers | 2 hours ago by kenes on Stack Overflow stackoverflow.com
0 answers

Tune parameters with nested SVM in MATLAB

I have a dataset of 20 test subjects with 50 variables and a result vector of 1 and 0 that determines their state. I would like to set up a nested cross validation such that I in the inner folds ...

1 answer

PCA for feature extraction MATLAB

I have a data matrix A of size N-by-M. I wanted use PCA for dimensionality reduction. I want to set the dimensions to 'k'. I understand that after feature extraction, I should get a Nxk matrix. I ...

1 answers | 2 hours ago by user2948166 on Stack Overflow stackoverflow.com
5 answers

Matlab simple matrix manip

I'm new to Matlab and I want to achieve a very simple operation : I have a 792 x 1046 uint8 matrix called mg and want to convert its cells values (from 0 to 255) to values between 1 and 4 (1,2,3,4) in ...

5 answers | 2 hours ago by medarum on Stack Overflow stackoverflow.com
0 answers

Wrap phase from image MATLAB

I am trying to unwrap the interference pattern that I got from the interferometre. However, the first step would be to wrap the phase, because I just got an image (intensity). I cannot post the image, ...

2 answers

figure('Position',[x y width height]) won't go over height 800

I'm using an external monitor. My notebook has display of height 800 px, but monitor has over 1000 px. If I'm running the script on external monitor screenSize = get(0,'MonitorPositions'); figureSize ...

2 answers | 3 hours ago by user50222 on Stack Overflow stackoverflow.com
1 answer

Dynamically name a struct variable in MATLAB

I have several files "2011-01-01.txt", "2013-01-02.txt", "2015-02-01.txt", etc. I wish to create a struct variable for each of the file such that (the values are made up): ...

2 answers

imquantsize function in matlab

I'm new to Matlab and trying to take a tif and find and apply multiple thresholds. I saved the tif using I=imread('full_file_directory') and used multithresh to find the threshold values. However ...

2 answers | 4 hours ago by user2906979 on Stack Overflow stackoverflow.com
3 answers

How to display with n decimal places in Matlab

I was wondering how to use command to set up displaying with n decimal places in Matlab? Must n be restricted to some predetermined numbers? Or one can just specify any for n? Thanks and regards!

3 answers | 4 hours ago by Tim on Stack Overflow stackoverflow.com
1 answer

In Matlab classdef can you define an “any_function”

In matlab's classdef, can you define a method that executes any_function that has called it? For example, say I have defined this custom class type in matlab: classdef custfloat properties value ...

1 answer

How to solve cudaSetDevice Error and run this deep-learning code correctly?

I use the following GPU code on the facial expression recognition: http://code.google.com/p/deep-learning-faces/ My system is the same as the authors' but the CUDA version is a little higher (5.5) ...

1 answer

Forcestop GlobalSearch function in matlab

I'm having an issue with an optimization problem. I think the code works fine, but I would like to force-stop it when it has reached a few optimal values(under 1e-11). The only solution I have found ...

1 answers | 5 hours ago by MaiGoL7 on Stack Overflow stackoverflow.com
1 answer

Converting a floating point number to string

I want to convert a floating point number to string. f=0.0000 str=num2str(f,4); This give me this- str= 0 But I wanted to keep the result till 4 decimal points.I understand using num2str(f,4) ...

1 answers | 5 hours ago by LifeIsGood on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3