Answered

Why does my function not return a figure when there is no error but when there is it returns a figure?

Change h = polarhistogram (deg2rad(x),deg2rad(y); to h = polarhistogram(deg2rad(x), deg2rad(y));

Why does my function not return a figure when there is no error but when there is it returns a figure?

Change h = polarhistogram (deg2rad(x),deg2rad(y); to h = polarhistogram(deg2rad(x), deg2rad(y));

4 days ago | 0

Answered

Time arithmetic (no dates)

tdiff = (hours(4)+minutes(30)) - (hours(2) + minutes(45)) [h, m, s] = hms(tdiff)

Time arithmetic (no dates)

tdiff = (hours(4)+minutes(30)) - (hours(2) + minutes(45)) [h, m, s] = hms(tdiff)

4 days ago | 2

| accepted

Answered

Can anyone please help me out to obtain frequency Modulated wave from a Phase Modulator using pmmod function in matlab?

fs = 50; t = (0:2*fs+1)'/fs; x = sin(2*pi*t) + sin(4*pi*t); fc = 10; phasedev = pi/2; tx = pmmod(x,fc,fs,phasedev); ...

Can anyone please help me out to obtain frequency Modulated wave from a Phase Modulator using pmmod function in matlab?

fs = 50; t = (0:2*fs+1)'/fs; x = sin(2*pi*t) + sin(4*pi*t); fc = 10; phasedev = pi/2; tx = pmmod(x,fc,fs,phasedev); ...

4 days ago | 0

Answered

its ask to prelocate speed on p line. why?

Why? In most circumstances, MATLAB does not examine the context to figure out how many iterations of a loop will be done, and s...

its ask to prelocate speed on p line. why?

Why? In most circumstances, MATLAB does not examine the context to figure out how many iterations of a loop will be done, and s...

4 days ago | 0

| accepted

Answered

How to find a proper algorithm to solve this optimal control problem?

You did not say what you wanted to optimzie with respect to. If you wanted to optimize with respect to u, then see solu below. ...

How to find a proper algorithm to solve this optimal control problem?

You did not say what you wanted to optimzie with respect to. If you wanted to optimize with respect to u, then see solu below. ...

4 days ago | 0

Answered

Unrecognized function or variable 'gca'

Summarizing: gca was being assigned to as a variable. With current versions of MATLAB, if you assign to a variable that has the...

Unrecognized function or variable 'gca'

Summarizing: gca was being assigned to as a variable. With current versions of MATLAB, if you assign to a variable that has the...

4 days ago | 1

| accepted

Answered

I am trying to find values of four constants from four equations. Yet the code is unable to give out values

When I try your code, I get all 0 for the constants. When I go through step by step from the equations, I get the same result...

I am trying to find values of four constants from four equations. Yet the code is unable to give out values

When I try your code, I get all 0 for the constants. When I go through step by step from the equations, I get the same result...

5 days ago | 0

| accepted

Answered

Unrecognized field name in solving symbolic matrix

You did not specify which variables to solve for, and you have more variables than equations. solve() choose variables to solve ...

Unrecognized field name in solving symbolic matrix

You did not specify which variables to solve for, and you have more variables than equations. solve() choose variables to solve ...

5 days ago | 0

| accepted

Answered

How to fit an uniform distribution to a histogram?

https://www.mathworks.com/help/stats/prctile.html Calculate the 98th prctile of the counts; that corresponds to 2 standard dev...

How to fit an uniform distribution to a histogram?

https://www.mathworks.com/help/stats/prctile.html Calculate the 98th prctile of the counts; that corresponds to 2 standard dev...

5 days ago | 0

Answered

Errors while trying to setup equation for root finding.

syms a k_pdo x_pdo x_glycerol z_pdo z_glycerol k_glycerol k_water x_water z_water eqn1 = x_pdo == z_pdo/(1 + a*(k_pdo - 1)); e...

Errors while trying to setup equation for root finding.

syms a k_pdo x_pdo x_glycerol z_pdo z_glycerol k_glycerol k_water x_water z_water eqn1 = x_pdo == z_pdo/(1 + a*(k_pdo - 1)); e...

5 days ago | 0

Answered

license of hdl coder

You will need to contact Mathworks for pricing for that particular product. Note: HDL Coder is not available for Student licen...

license of hdl coder

You will need to contact Mathworks for pricing for that particular product. Note: HDL Coder is not available for Student licen...

6 days ago | 0

| accepted

Answered

How does Matlab perform large integer modular arithmetics using Symbolic Math Toolbox?

S1 = char(evalin(symengine, 'expose(symobj::powermod)')); S1 = regexprep(S1, '\\n', '\n') S2 = char(evalin(symengine, 'expose(...

How does Matlab perform large integer modular arithmetics using Symbolic Math Toolbox?

S1 = char(evalin(symengine, 'expose(symobj::powermod)')); S1 = regexprep(S1, '\\n', '\n') S2 = char(evalin(symengine, 'expose(...

6 days ago | 0

Answered

Explanation for : Warning: Integer operands are required for colon operator when used as index. > In welch>localComputeSpectra (line 379)

Your No variable corresponds to the overlap which is required to be a positive integer according to the documentation. However w...

Explanation for : Warning: Integer operands are required for colon operator when used as index. > In welch>localComputeSpectra (line 379)

Your No variable corresponds to the overlap which is required to be a positive integer according to the documentation. However w...

6 days ago | 0

Answered

Is this a bug? different results when performing simple math operation (A * (B - C)) with scalars or variables

If you use format long g you will see that ptfDur is not exactly the same as the constant 4.5501 . For example, test ptfDur -...

Is this a bug? different results when performing simple math operation (A * (B - C)) with scalars or variables

If you use format long g you will see that ptfDur is not exactly the same as the constant 4.5501 . For example, test ptfDur -...

6 days ago | 1

| accepted

Answered

How to stop result being rounded - Symbolic mathematics

No problems here. syms t positive %Describe the voltage and current functions v=(10000*t+5)*exp(-400*t); i=(40*t+0.05)*exp(-...

How to stop result being rounded - Symbolic mathematics

No problems here. syms t positive %Describe the voltage and current functions v=(10000*t+5)*exp(-400*t); i=(40*t+0.05)*exp(-...

6 days ago | 0

| accepted

Answered

Matlab getting stuck , no output

function [hist,searchdir] = runfmincon hist.x = []; hist.fval = []; searchdir = []; x0 = [0.3 0.02 0.2]; lb = [0.2 0.0...

Matlab getting stuck , no output

function [hist,searchdir] = runfmincon hist.x = []; hist.fval = []; searchdir = []; x0 = [0.3 0.02 0.2]; lb = [0.2 0.0...

6 days ago | 0

Answered

Save Figure Using First Subplot Name

FigName = ax(end).Title.String; The first axes created in the figure will be the last axes object in Children order (unle...

Save Figure Using First Subplot Name

FigName = ax(end).Title.String; The first axes created in the figure will be the last axes object in Children order (unle...

6 days ago | 0

Answered

Android project directory path name exceeds the 119 character

Quit MATLAB (for the moment) Rename C:\Users\Guilherme\Documents\MATLAB to a shorter name, such as C:\Users\Guilherme\Documents...

Android project directory path name exceeds the 119 character

Quit MATLAB (for the moment) Rename C:\Users\Guilherme\Documents\MATLAB to a shorter name, such as C:\Users\Guilherme\Documents...

6 days ago | 0

Answered

how do i automatically select the kernel size like 5*5, 7*7... instead of the 3*3 in the code below

window_size = randi([2 6]) * 2 - 1 hws = (window_size - 1)/2; es = imread('cameraman.tif'); assert(ndims(es) == 2, 'Grays...

how do i automatically select the kernel size like 5*5, 7*7... instead of the 3*3 in the code below

window_size = randi([2 6]) * 2 - 1 hws = (window_size - 1)/2; es = imread('cameraman.tif'); assert(ndims(es) == 2, 'Grays...

6 days ago | 0

Answered

I am a beginner-level programmer. Kindly help me to count the number of images from multiple folders at once

dinfo = dir(fullfile('*', '*.jpg')); folders = {dinfo.folder}; [~, basefolder] = fileparts(folders); [G, folder_name] = findg...

I am a beginner-level programmer. Kindly help me to count the number of images from multiple folders at once

dinfo = dir(fullfile('*', '*.jpg')); folders = {dinfo.folder}; [~, basefolder] = fileparts(folders); [G, folder_name] = findg...

7 days ago | 0

| accepted

Answered

How can I define bin edges for histogram?

edges = linspace(40, 80, 8+1)

How can I define bin edges for histogram?

edges = linspace(40, 80, 8+1)

7 days ago | 0

| accepted

Answered

program is not showing graph

You have function y=f(x,theta) You are passing in a variable named x k0=(2*pi/0.6328)*1e6; That's a value in the millions n...

program is not showing graph

You have function y=f(x,theta) You are passing in a variable named x k0=(2*pi/0.6328)*1e6; That's a value in the millions n...

7 days ago | 0

Answered

What would be the MatLab code to get the output from the input image?.

colidx = sum(cumprod(~cellfun(@isempty, INPUT), 2),2) + 1; OUTPUT = INPUT(sub2ind(size(INPUT), 1:size(INPUT,1), colidx)); This...

What would be the MatLab code to get the output from the input image?.

colidx = sum(cumprod(~cellfun(@isempty, INPUT), 2),2) + 1; OUTPUT = INPUT(sub2ind(size(INPUT), 1:size(INPUT,1), colidx)); This...

7 days ago | 0

| accepted

Answered

MATLAB Curve fitting with custom equation (max/min)

You can bind it in using an anonymous function; http://www.mathworks.com/help/matlab/math/parameterizing-functions.html However...

MATLAB Curve fitting with custom equation (max/min)

You can bind it in using an anonymous function; http://www.mathworks.com/help/matlab/math/parameterizing-functions.html However...

7 days ago | 0

Answered

pop-up menu (GUI,guide)

Before if mainList=='temperature' if innerList1=='Celsius' if innerList2=='Fahrenheit' insert mainList_options ...

pop-up menu (GUI,guide)

Before if mainList=='temperature' if innerList1=='Celsius' if innerList2=='Fahrenheit' insert mainList_options ...

7 days ago | 0

| accepted

Answered

How can we continuously save the mouse tracking positions with respect to time in workspace

https://matlab.fandom.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

How can we continuously save the mouse tracking positions with respect to time in workspace

https://matlab.fandom.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

7 days ago | 0

| accepted

Answered

Reformat table with a column as a top row

You can get the Tvalue / PValue to be the same by making each variable in the table be a table itself. However, there is no way...

Reformat table with a column as a top row

You can get the Tvalue / PValue to be the same by making each variable in the table be a table itself. However, there is no way...

7 days ago | 0

Answered

Error in using eval statement

Asking how to use eval without problems is like asking how to use a chainsaw without its chain guard. It would be irresponsible ...

Error in using eval statement

Asking how to use eval without problems is like asking how to use a chainsaw without its chain guard. It would be irresponsible ...

7 days ago | 0

Answered

Images merging using matlab

orig_filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/858715/CXR00000001.png'; roi_filename = 'https:...

Images merging using matlab

orig_filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/858715/CXR00000001.png'; roi_filename = 'https:...

7 days ago | 1

| accepted

Answered

how can I solve this error in this code?

opt_apt appears to be part of the File Exchange Contribution https://www.mathworks.com/matlabcentral/fileexchange/60874-fotf-too...

how can I solve this error in this code?

opt_apt appears to be part of the File Exchange Contribution https://www.mathworks.com/matlabcentral/fileexchange/60874-fotf-too...

7 days ago | 0