Answered

How to replace every element of a matrix with another column matrix?

If you don't have the Deep Learning Toolbox, try this: y=[0,1,4,2,5,1,5,9,8] output = zeros(9, length(y)) for col = 1 : lengt...

How to replace every element of a matrix with another column matrix?

If you don't have the Deep Learning Toolbox, try this: y=[0,1,4,2,5,1,5,9,8] output = zeros(9, length(y)) for col = 1 : lengt...

11 days ago | 1

| accepted

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

Since ecgBR has only one row, not n, you cannot do ecgBR(n, 1), which is the nth row in column 1. But you have 3600 columns, no...

Unable to perform assignment because the left and right sides have a different number of elements.

Since ecgBR has only one row, not n, you cannot do ecgBR(n, 1), which is the nth row in column 1. But you have 3600 columns, no...

11 days ago | 0

| accepted

Answered

continuous representation (image generation) of discrete data set

It looks like there is a whole toolbox at that site. Did you look it over for functions that might do that? Otherwise, see my ...

continuous representation (image generation) of discrete data set

It looks like there is a whole toolbox at that site. Did you look it over for functions that might do that? Otherwise, see my ...

11 days ago | 0

| accepted

Answered

Compiling large nested folder structure

If file1.m is your main file, and it's in folder "a", then make "a" your current folder and do mcc file1.m -o test.exe -W WinMa...

Compiling large nested folder structure

If file1.m is your main file, and it's in folder "a", then make "a" your current folder and do mcc file1.m -o test.exe -W WinMa...

12 days ago | 0

Answered

Error using cd Cannot CD to 7364 (Name is nonexistent or not a directory).

Get rid of all calls to cd and get the full file names like this: topLevelFolder = 'D:\My Videos' % Wherever you want. filePat...

Error using cd Cannot CD to 7364 (Name is nonexistent or not a directory).

Get rid of all calls to cd and get the full file names like this: topLevelFolder = 'D:\My Videos' % Wherever you want. filePat...

12 days ago | 0

Answered

Error using cd Cannot CD to 7364 (Name is nonexistent or not a directory).

DO NOT use cd. Use fullfile() to create full file names. See The FAQ: https://matlab.fandom.com/wiki/FAQ#Where_did_my_file_go....

Error using cd Cannot CD to 7364 (Name is nonexistent or not a directory).

DO NOT use cd. Use fullfile() to create full file names. See The FAQ: https://matlab.fandom.com/wiki/FAQ#Where_did_my_file_go....

12 days ago | 0

Answered

Error by creating video from images

I think your axes must be changing size or shape so your image is not the same size. Try not specifying the 'Resolution' option...

Error by creating video from images

I think your axes must be changing size or shape so your image is not the same size. Try not specifying the 'Resolution' option...

12 days ago | 0

Answered

Matlab predictor-corrector

As long as all coordinates of A, B, and C are known, then if your guess for the slope between C and D lies between the slope of ...

Matlab predictor-corrector

As long as all coordinates of A, B, and C are known, then if your guess for the slope between C and D lies between the slope of ...

12 days ago | 0

Answered

Select area in picture and send information about r,g,b

What information do you need? For example, you can mask it and get the means and area. See attached demo. You can get the his...

Select area in picture and send information about r,g,b

What information do you need? For example, you can mask it and get the means and area. See attached demo. You can get the his...

12 days ago | 0

Answered

how to extract black pixels and white ones in a grayscale image ?

If black pixels are considered those with values equal to or less than "threshold", you can do numBlackPixels = nnz(grayImage <...

how to extract black pixels and white ones in a grayscale image ?

If black pixels are considered those with values equal to or less than "threshold", you can do numBlackPixels = nnz(grayImage <...

12 days ago | 0

| accepted

Answered

How can i move excel sheets in the same file

For what it's worth, I have a static method in my Excel_utils class that lets you move a worksheet to be the first one. It's pr...

How can i move excel sheets in the same file

For what it's worth, I have a static method in my Excel_utils class that lets you move a worksheet to be the first one. It's pr...

13 days ago | 0

Answered

Find the upper surface of a 3d object.

Try using scatteredInterpolant() to get a z value for every combination of x and y. See attached demo.

Find the upper surface of a 3d object.

Try using scatteredInterpolant() to get a z value for every combination of x and y. See attached demo.

14 days ago | 0

| accepted

Answered

extract the region of interest in a color image

Since it's not clear where the boundary of the region is in the upper left, I suggest you manually trace it out. I'm attaching ...

extract the region of interest in a color image

Since it's not clear where the boundary of the region is in the upper left, I suggest you manually trace it out. I'm attaching ...

14 days ago | 0

| accepted

Answered

Segmentation violation if a for-loop (Ubuntu 18.04, Matlab2018b)

Does it crash when it hits one particular line of code in your MATLAB program? Are you running/calling a mex file or DLL that i...

Segmentation violation if a for-loop (Ubuntu 18.04, Matlab2018b)

Does it crash when it hits one particular line of code in your MATLAB program? Are you running/calling a mex file or DLL that i...

14 days ago | 0

Answered

Digital image correlation error

Not really sure what you want to do but I worked on it way too long (like 45 minutes) to improve it and this is where it stands....

Digital image correlation error

Not really sure what you want to do but I worked on it way too long (like 45 minutes) to improve it and this is where it stands....

14 days ago | 0

Answered

How i can solve this exercise in matlab???To calculate the values of the function on the given segment In N points to equal intervals from each other. Point 7

Try this: x = linspace(-pi, pi, n); y = exp(x) .* sin(x) + exp(-x) .* cos(x);

How i can solve this exercise in matlab???To calculate the values of the function on the given segment In N points to equal intervals from each other. Point 7

Try this: x = linspace(-pi, pi, n); y = exp(x) .* sin(x) + exp(-x) .* cos(x);

14 days ago | 0

Answered

spot diameter in imported image

Try this: clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all e...

spot diameter in imported image

Try this: clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all e...

14 days ago | 0

| accepted

Answered

stokes waves dynamic pressure

Use the plot() function, the xlabel() and ylabel() functions, the text() function, and the legend() function.

stokes waves dynamic pressure

Use the plot() function, the xlabel() and ylabel() functions, the text() function, and the legend() function.

15 days ago | 0

Answered

How to convert m code file script to a function for using in excel add-Ins?

Put the keyword "function" on the first line, get rid of clear all, and make sure you don't define any of the input variables or...

How to convert m code file script to a function for using in excel add-Ins?

Put the keyword "function" on the first line, get rid of clear all, and make sure you don't define any of the input variables or...

15 days ago | 0

Answered

How do I multiply specific numbers in two different matrices by each other?

Just use indexing, as like any other programming language, for example output = A(3) * B(2) Replace * with / or + or whatever ...

How do I multiply specific numbers in two different matrices by each other?

Just use indexing, as like any other programming language, for example output = A(3) * B(2) Replace * with / or + or whatever ...

15 days ago | 1

| accepted

Answered

Image Region Filtering, Line Fitting

Check pubmed or vision bibliography to find papers discussing segmentation of vertebrae. I know there will be some there.

Image Region Filtering, Line Fitting

Check pubmed or vision bibliography to find papers discussing segmentation of vertebrae. I know there will be some there.

15 days ago | 0

Answered

how to create rounded edges of an irregular object? I want to smoothen the corners of this object.

You can blur the image with imfilter() or conv2(): windowSize = 21; % Bigger for more blurring. kernel = ones(windowSize) / wi...

how to create rounded edges of an irregular object? I want to smoothen the corners of this object.

You can blur the image with imfilter() or conv2(): windowSize = 21; % Bigger for more blurring. kernel = ones(windowSize) / wi...

15 days ago | 0

| accepted

Answered

How to solve the equation shown in image below?

I also get 161, as you can see by plotting it: Vau = 43; Vsu = 47.51; % 47.45 gamma = 5/3; beta = 1.41; theta_u = linspace(...

How to solve the equation shown in image below?

I also get 161, as you can see by plotting it: Vau = 43; Vsu = 47.51; % 47.45 gamma = 5/3; beta = 1.41; theta_u = linspace(...

15 days ago | 0

Answered

how do you create a model for a sum of exponentials?

The attached demo fits any number of Gaussians to a signal. The demo uses 6 as an example, but you can change it to however man...

how do you create a model for a sum of exponentials?

The attached demo fits any number of Gaussians to a signal. The demo uses 6 as an example, but you can change it to however man...

15 days ago | 0

Answered

How to "force" a data to start and end at zero y values?

Just use polyfit on the first and last points to get a ramp. Then subtract the ramp from all the y values. The first and last ...

How to "force" a data to start and end at zero y values?

Just use polyfit on the first and last points to get a ramp. Then subtract the ramp from all the y values. The first and last ...

16 days ago | 1

| accepted

Answered

How to run a for loop when variables are different lengths?

You can do it vectorized using meshgrid(). Try this: delta = -23.28:0.01:23.28; phi = -90:1:90; [deltaAll, phiAll] = meshgri...

How to run a for loop when variables are different lengths?

You can do it vectorized using meshgrid(). Try this: delta = -23.28:0.01:23.28; phi = -90:1:90; [deltaAll, phiAll] = meshgri...

16 days ago | 0

Answered

error trying to fit two arrays with an exponential fit

Try this: % Uses fitnlm() to fit a non-linear model (an exponential decay curve) through noisy data. % Requires the Statistics...

error trying to fit two arrays with an exponential fit

Try this: % Uses fitnlm() to fit a non-linear model (an exponential decay curve) through noisy data. % Requires the Statistics...

16 days ago | 0

Answered

Remove noise parts in the signal

Here is some improved code. But I'm not quite sure what you want. % Initialization steps. clc; % Clear the command window....

Remove noise parts in the signal

Here is some improved code. But I'm not quite sure what you want. % Initialization steps. clc; % Clear the command window....

16 days ago | 0

Answered

Is there a Way to Determine Which Function Will be Called Without Actually Calling the Function ?

Use which -all myfunc Also, try running the attached script.

Is there a Way to Determine Which Function Will be Called Without Actually Calling the Function ?

Use which -all myfunc Also, try running the attached script.

16 days ago | 0

Answered

Edge detection on Video

I know it's a 5 year old question, but I recently did a demo for another question that took the Canny edge of a video, in case a...

Edge detection on Video

I know it's a 5 year old question, but I recently did a demo for another question that took the Canny edge of a video, in case a...

16 days ago | 0