Answered

12bit to 8 bit and Windowing

In older MATLAB see mat2gray, which has a deceptive function name and is not restricted to grayscale like the name suggests. ...

12bit to 8 bit and Windowing

In older MATLAB see mat2gray, which has a deceptive function name and is not restricted to grayscale like the name suggests. ...

2 hours ago | 0

Answered

Symbolically differentiation a function w.r.t a function

You cannot differentiate a function with respect to a different unknown function with normal calculus, because you cannot know t...

Symbolically differentiation a function w.r.t a function

You cannot differentiate a function with respect to a different unknown function with normal calculus, because you cannot know t...

2 hours ago | 0

Answered

Compare and select values from an matrix.

min(A(1:2:end,:), A(2:2:end, :))

Compare and select values from an matrix.

min(A(1:2:end,:), A(2:2:end, :))

17 hours ago | 0

| accepted

Answered

Error in resizing GUIDE gui

Change line 2765 of guidefunc from if ~strcmpi(get(children(i),'Units'), 'normalized') to if hasfield(childre...

Error in resizing GUIDE gui

Change line 2765 of guidefunc from if ~strcmpi(get(children(i),'Units'), 'normalized') to if hasfield(childre...

17 hours ago | 0

Answered

Using equationTomatrix changes the order of units in the final matrix. How do you maintain the order?

Pass in the vars option to the function to get the results to be in that order.

Using equationTomatrix changes the order of units in the final matrix. How do you maintain the order?

Pass in the vars option to the function to get the results to be in that order.

18 hours ago | 0

Answered

create a vector without for

a=1:10; b=1:10; c=1:3; d=1:5; [A, B, C, D] = ndgrid(uint8(a), uint8(b), uint8(c), uint8(d)) ; v = [A(:), B(:)...

create a vector without for

a=1:10; b=1:10; c=1:3; d=1:5; [A, B, C, D] = ndgrid(uint8(a), uint8(b), uint8(c), uint8(d)) ; v = [A(:), B(:)...

18 hours ago | 1

| accepted

Answered

Issue with running a script calling "parts" function on the MATLAB Online R2019b

https://www.mathworks.com/matlabcentral/answers/481537-submitwithconfiguration-not-working-in-matlab-r2019b

Issue with running a script calling "parts" function on the MATLAB Online R2019b

https://www.mathworks.com/matlabcentral/answers/481537-submitwithconfiguration-not-working-in-matlab-r2019b

19 hours ago | 0

| accepted

Answered

VERY slow for loop

You do not use the variable i inside your for loop, so you are testing the entire energy variable of the table every time throug...

VERY slow for loop

You do not use the variable i inside your for loop, so you are testing the entire energy variable of the table every time throug...

23 hours ago | 1

| accepted

Answered

How to assign numbers to letters of the alphabet. Ex. A/a=1 B/b=2

https://www.mathworks.com/help/matlab/ref/lower.html https://www.mathworks.com/help/matlab/ref/ismember.html https://www.math...

How to assign numbers to letters of the alphabet. Ex. A/a=1 B/b=2

https://www.mathworks.com/help/matlab/ref/lower.html https://www.mathworks.com/help/matlab/ref/ismember.html https://www.math...

24 hours ago | 0

Answered

Unique Number Assignment To Each Time

Use the third output of unique(). Or use findgroups()

Unique Number Assignment To Each Time

Use the third output of unique(). Or use findgroups()

1 day ago | 0

Answered

plotting ode warning with nor plot returned

You dsolve() and store the answer but then you try to fplot the unprocessed A and B. At the very least you would want to plot S....

plotting ode warning with nor plot returned

You dsolve() and store the answer but then you try to fplot the unprocessed A and B. At the very least you would want to plot S....

1 day ago | 0

Answered

expression is too large, symengine can't calculate

Create eqns = [obj.dx,obj.dS(:);obj.dSS(:)]; Now break that up into chunks. For example: At_a_time = 10; num_eqn = length(eq...

expression is too large, symengine can't calculate

Create eqns = [obj.dx,obj.dS(:);obj.dSS(:)]; Now break that up into chunks. For example: At_a_time = 10; num_eqn = length(eq...

1 day ago | 0

Answered

Better way to pull out values from a struct

Times = arrayfun(@(S) S.callsTable.Time, CT, 'uniform', 0); T = horzcat(Times{:}); The assignment to T will fail if the Time...

Better way to pull out values from a struct

Times = arrayfun(@(S) S.callsTable.Time, CT, 'uniform', 0); T = horzcat(Times{:}); The assignment to T will fail if the Time...

1 day ago | 0

Answered

how to obtain volume data from X,Y,Z,c data to use slice() function?

N = 50; xvec = linspace(592447.8, 592463.9, N); yvec = linspace(507793.3, 507837.4, N); zvec = linspace(2553.6, 2559.9, N);...

how to obtain volume data from X,Y,Z,c data to use slice() function?

N = 50; xvec = linspace(592447.8, 592463.9, N); yvec = linspace(507793.3, 507837.4, N); zvec = linspace(2553.6, 2559.9, N);...

1 day ago | 0

| accepted

Answered

Eliminate tables with more than 15% NaN data

filetables = load('C.mat'); numtables = numel(filetables); tablenames = fieldnames(filetables); droptable = false(1, numtab...

Eliminate tables with more than 15% NaN data

filetables = load('C.mat'); numtables = numel(filetables); tablenames = fieldnames(filetables); droptable = false(1, numtab...

2 days ago | 2

Answered

Subplot, 1 large and 2 small

subplot(2, 2, [1 3]) %draw for A subplot(2, 2, 2) %draw for B subplot(2, 2, 4) %draw for C

Subplot, 1 large and 2 small

subplot(2, 2, [1 3]) %draw for A subplot(2, 2, 2) %draw for B subplot(2, 2, 4) %draw for C

2 days ago | 0

| accepted

Answered

Error using fprintf Unable to convert 'sym' value to 'double'.

fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n',[UI1,SG13,SG12]); fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n\n',[SG13,UI2,S...

Error using fprintf Unable to convert 'sym' value to 'double'.

fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n',[UI1,SG13,SG12]); fprintf(nru,'{ %.3f uta1 + %.2f uta2 = -%.2f\n\n',[SG13,UI2,S...

2 days ago | 0

Answered

Calling a function from a script

Example of calling a function from a script: x = input('Input x '); y = xsquared(x); disp(y) function y = xsquared(x) ...

Calling a function from a script

Example of calling a function from a script: x = input('Input x '); y = xsquared(x); disp(y) function y = xsquared(x) ...

2 days ago | 0

Answered

Trying too run two functions in parallel where the functions have two outputs

funcs1 = {@linear_programming_bound, @linear_programming_bound}; arguments1 = {W,b,Xmins(:,j),Xmaxes(:,j); ...

Trying too run two functions in parallel where the functions have two outputs

funcs1 = {@linear_programming_bound, @linear_programming_bound}; arguments1 = {W,b,Xmins(:,j),Xmaxes(:,j); ...

2 days ago | 0

| accepted

Answered

Solving Symbolic Equations with Solve-Creating a GUI

temp = struct2cell(rptas); results = vertcat(temp{:}); However, you need to be careful with this, as the order of fields in rp...

Solving Symbolic Equations with Solve-Creating a GUI

temp = struct2cell(rptas); results = vertcat(temp{:}); However, you need to be careful with this, as the order of fields in rp...

2 days ago | 0

Answered

Cell2mat not working for unequal length cell data/array

Nmsg = length(canMsgs.Data); msglen = cellfun(@length, canMsgs.Data); maxlen = max(msglen); C = nan(Nmsg, maxlen); for i = 1...

Cell2mat not working for unequal length cell data/array

Nmsg = length(canMsgs.Data); msglen = cellfun(@length, canMsgs.Data); maxlen = max(msglen); C = nan(Nmsg, maxlen); for i = 1...

2 days ago | 0

Answered

solving equation with if statements

syms theta kappa alpha time y real eqn = y == piecewise(time < alpha, exp(-kappa*time), exp(-kappa)*exp(-theta*(time-alpha))...

solving equation with if statements

syms theta kappa alpha time y real eqn = y == piecewise(time < alpha, exp(-kappa*time), exp(-kappa)*exp(-theta*(time-alpha))...

2 days ago | 0

Answered

How to read a binary file with below description?

filename = 'appropriatefile.les'; [fid, msg] = fopen(filename); if fid < 0 error('Filed to open file "%s" because "%s"', ...

How to read a binary file with below description?

filename = 'appropriatefile.les'; [fid, msg] = fopen(filename); if fid < 0 error('Filed to open file "%s" because "%s"', ...

2 days ago | 0

Answered

I want to understand a function "fastmarchingmex" .

The source code for that function is available to employees and interns of Mathworks, but not to the public.

I want to understand a function "fastmarchingmex" .

The source code for that function is available to employees and interns of Mathworks, but not to the public.

3 days ago | 0

Answered

Concerning some error For Loop in my optimal control problem

Inside a quoted string 'i' the symbolic engine will always interpret 'i' as sqrt(-1) and never as the current value of i You ...

Concerning some error For Loop in my optimal control problem

Inside a quoted string 'i' the symbolic engine will always interpret 'i' as sqrt(-1) and never as the current value of i You ...

3 days ago | 0

| accepted

Answered

how to read complex file data to matrix

Sometimes easiest is to read the file as a character vector, use regexp to remove the space around the sign of the imaginary par...

how to read complex file data to matrix

Sometimes easiest is to read the file as a character vector, use regexp to remove the space around the sign of the imaginary par...

3 days ago | 0

Answered

Unable to display symbolic object because 'symengine' was reset

You install more RAM. You are running out of memory during the symbolic computation. You should probably be using sig\der ins...

Unable to display symbolic object because 'symengine' was reset

You install more RAM. You are running out of memory during the symbolic computation. You should probably be using sig\der ins...

3 days ago | 0

Answered

GUI to interface Matlab with Omicron (Significance of the syntex used)

It is not impossible that there is a significance to the ' at that point, but chances are not high. For there to be a signifi...

GUI to interface Matlab with Omicron (Significance of the syntex used)

It is not impossible that there is a significance to the ' at that point, but chances are not high. For there to be a signifi...

3 days ago | 0

Answered

How to set() plot in matlab with cell array

You cannot do that. When you have multiple lines to plot then each of them must have its own line object h = plot(x, y_with...

How to set() plot in matlab with cell array

You cannot do that. When you have multiple lines to plot then each of them must have its own line object h = plot(x, y_with...

3 days ago | 0