Answered

How to write this pseudocode in matlab?

https://www.mathworks.com/help/matlab/ref/graph.shortestpathtree.html

How to write this pseudocode in matlab?

https://www.mathworks.com/help/matlab/ref/graph.shortestpathtree.html

3 hours ago | 0

Answered

preallocate memory for a struct in a for loop

for i = size(filename,1) : -1 : 1 spectra(i).name = filename(i,1:end-4); spectra(i).value = readmatrix(filename(i,:));...

preallocate memory for a struct in a for loop

for i = size(filename,1) : -1 : 1 spectra(i).name = filename(i,1:end-4); spectra(i).value = readmatrix(filename(i,:));...

3 hours ago | 0

| accepted

Answered

Error matlab r2017b

You do not have read access to C:\Program Files\MATLAB\R2017b\toolbox\local\pathdef.m and possibly to other MATLAB files as well...

Error matlab r2017b

You do not have read access to C:\Program Files\MATLAB\R2017b\toolbox\local\pathdef.m and possibly to other MATLAB files as well...

6 hours ago | 0

Answered

If I have to perform arithmetic encoding on a sequence such as "222101" where one of the digits is 0 , how do I solve the error "The symbol sequence parameter must be a vector of positive finite integers"?

In R2020a, you need to edit line 173 of arithenco to change if ~all(seq > 0) || ~all(isfinite(seq)) || ~isequal(seq, round(seq)...

If I have to perform arithmetic encoding on a sequence such as "222101" where one of the digits is 0 , how do I solve the error "The symbol sequence parameter must be a vector of positive finite integers"?

In R2020a, you need to edit line 173 of arithenco to change if ~all(seq > 0) || ~all(isfinite(seq)) || ~isequal(seq, round(seq)...

6 hours ago | 0

Answered

I can't find the mistakes

desen_cercuri_Callback assigns to x01, y01 and so on, but tries to plot(x1,y1,z1,x2,y2,z2) -- notice the x01 vs x1. Note that y...

I can't find the mistakes

desen_cercuri_Callback assigns to x01, y01 and so on, but tries to plot(x1,y1,z1,x2,y2,z2) -- notice the x01 vs x1. Note that y...

20 hours ago | 0

Answered

Adding two linear inequality constraints in Optimization toolbox

I refer you to https://www.mathworks.com/matlabcentral/answers/557419-constraint-function-in-optimization-toolbox#answer_459217...

Adding two linear inequality constraints in Optimization toolbox

I refer you to https://www.mathworks.com/matlabcentral/answers/557419-constraint-function-in-optimization-toolbox#answer_459217...

20 hours ago | 0

Answered

Bit xor of row with the next row and the output is again xored with the next row

c = 245; A = [23 2 13;34 56 70;12 18 90]; a = []; [m, n] = size(A); a(1,:) = bitxor(c,A(1,:)); %Xor c with each element of...

Bit xor of row with the next row and the output is again xored with the next row

c = 245; A = [23 2 13;34 56 70;12 18 90]; a = []; [m, n] = size(A); a(1,:) = bitxor(c,A(1,:)); %Xor c with each element of...

20 hours ago | 0

Answered

If I change the folder names in the popup menu and i need to get the files in that folder to the list box and similar if i change to other folder , that folders files should come

ph = handles.YourPopup; lh = handles.YourListbox; selection_index = ph.Value; if ~isempty(selection_index) user_chosen_f...

If I change the folder names in the popup menu and i need to get the files in that folder to the list box and similar if i change to other folder , that folders files should come

ph = handles.YourPopup; lh = handles.YourListbox; selection_index = ph.Value; if ~isempty(selection_index) user_chosen_f...

21 hours ago | 0

Answered

How to numerically solve a differential equation with a dirac delta function ?

Use ode45 to solve the equation over the start time to time 1 (the place the dirac delta is located.) Do not use the if statemen...

How to numerically solve a differential equation with a dirac delta function ?

Use ode45 to solve the equation over the start time to time 1 (the place the dirac delta is located.) Do not use the if statemen...

21 hours ago | 0

Answered

Data String unreadable in uitable matlab

Your use of 'Nama' as a header suggets that you expect the column you are selecting to be character vectors -- names. However wh...

Data String unreadable in uitable matlab

Your use of 'Nama' as a header suggets that you expect the column you are selecting to be character vectors -- names. However wh...

23 hours ago | 0

Answered

How to generate random numbers between min and max value with gevrnd?I

https://www.mathworks.com/help/stats/prob.normaldistribution.truncate.html truncate() the distribution. That will automatically...

How to generate random numbers between min and max value with gevrnd?I

https://www.mathworks.com/help/stats/prob.normaldistribution.truncate.html truncate() the distribution. That will automatically...

1 day ago | 0

| accepted

Answered

Resampling Data using Interp1

load('BNI_processed.mat') input_forces = Force_arr(:,2); time_matrix = Force_arr(:,1); Fs = 100; last_time = ceil(time_matri...

Resampling Data using Interp1

load('BNI_processed.mat') input_forces = Force_arr(:,2); time_matrix = Force_arr(:,1); Fs = 100; last_time = ceil(time_matri...

1 day ago | 0

Answered

No appropriate method, property, or field 'Files' for class 'augmentedImageDatastore'.

Hack way: old_warning_state = warning('off', 'MATLAB:structOnObject'); temp = struct(augimdsValidation); warning(old_warning_...

No appropriate method, property, or field 'Files' for class 'augmentedImageDatastore'.

Hack way: old_warning_state = warning('off', 'MATLAB:structOnObject'); temp = struct(augimdsValidation); warning(old_warning_...

1 day ago | 0

Answered

Understanding Precision in Matlab

You cannot do that with double precision. If you have the symbolic toolbox then: r = linspace(sym('5.047639467288342e+4'), sym...

Understanding Precision in Matlab

You cannot do that with double precision. If you have the symbolic toolbox then: r = linspace(sym('5.047639467288342e+4'), sym...

1 day ago | 0

Answered

Identifying identical vectors within a cell array and then grouping/moving them into a different cell arrays

data = {[5]; [1,2,3,5,6]; [1,2,3,5]; [3,5,6]; [1,2,3,4,5,6]; [3,5,6]; [3,4,6]; [5,6]; [1,2,3,6]; [5,6]; [5,6]; [5,6]; [1,2,3,4,5...

Identifying identical vectors within a cell array and then grouping/moving them into a different cell arrays

data = {[5]; [1,2,3,5,6]; [1,2,3,5]; [3,5,6]; [1,2,3,4,5,6]; [3,5,6]; [3,4,6]; [5,6]; [1,2,3,6]; [5,6]; [5,6]; [5,6]; [1,2,3,4,5...

1 day ago | 1

| accepted

Answered

2D array interpolation

Assuming that array is stored in data vals_to_find = [120 140]; nvals = length(vals_to_find); D = data(2:end,2:end); X = d...

2D array interpolation

Assuming that array is stored in data vals_to_find = [120 140]; nvals = length(vals_to_find); D = data(2:end,2:end); X = d...

1 day ago | 0

Answered

Extract each value from rows of excel sheet for 40 iterations

values = xlsread('Filename.xlsx'); for iteration = 1 : length(values) K = values(iteration); do something with K e...

Extract each value from rows of excel sheet for 40 iterations

values = xlsread('Filename.xlsx'); for iteration = 1 : length(values) K = values(iteration); do something with K e...

1 day ago | 0

| accepted

Answered

Creat a big matrix by adding elements from smaller matrices

part1 = blkdiag(a,c,e,g, zeros(7,7)); part2 = blkdiag(zeros(7,7),b,d,f,h); K = part1 + part2;

Creat a big matrix by adding elements from smaller matrices

part1 = blkdiag(a,c,e,g, zeros(7,7)); part2 = blkdiag(zeros(7,7),b,d,f,h); K = part1 + part2;

1 day ago | 1

| accepted

Answered

Index exceeds the number of array elements (1).

If you subs in a particular value for lambda then after the subs() d2L contains only dy, and since you did not specify a variabl...

Index exceeds the number of array elements (1).

If you subs in a particular value for lambda then after the subs() d2L contains only dy, and since you did not specify a variabl...

1 day ago | 1

| accepted

Answered

Running the Same code for Multiple Files in a Folder

indir = '.'; %path to input directory outdir = 'results'; %path to where to put the results if ~exist(outdir, '...

Running the Same code for Multiple Files in a Folder

indir = '.'; %path to input directory outdir = 'results'; %path to where to put the results if ~exist(outdir, '...

1 day ago | 0

| accepted

Answered

Can I keep the text of my delimiter or LineEnding when using readcell, readtable, etc.?

That is not possible using readtable() or readmatrix() or readcell() . You can pre-process the file: S = fileread(filename); ...

Can I keep the text of my delimiter or LineEnding when using readcell, readtable, etc.?

That is not possible using readtable() or readmatrix() or readcell() . You can pre-process the file: S = fileread(filename); ...

1 day ago | 1

| accepted

Answered

How to use histogram equalization for a given image, without including the black background ?

However, Matlab keeps (automatically) adding a black background to my images. I am not aware of even one image file format that...

How to use histogram equalization for a given image, without including the black background ?

However, Matlab keeps (automatically) adding a black background to my images. I am not aware of even one image file format that...

1 day ago | 0

| accepted

Answered

breakpoints specification does not supported in lookup table matlab2014b

https://web.archive.org/web/20150212023953/http://www.mathworks.com/help/simulink/slref/ndlookuptable.html The n-D lookup tabl...

breakpoints specification does not supported in lookup table matlab2014b

https://web.archive.org/web/20150212023953/http://www.mathworks.com/help/simulink/slref/ndlookuptable.html The n-D lookup tabl...

1 day ago | 0

Answered

Constraint function in optimization toolbox

function [c,ceq] = csp_advisor(TotalmassFlow) The constraint function is passed the current value of all of the variables -- wh...

Constraint function in optimization toolbox

function [c,ceq] = csp_advisor(TotalmassFlow) The constraint function is passed the current value of all of the variables -- wh...

1 day ago | 0

Answered

How to upgrade MATLAB R2020a

You cannot "upgrade" between releases, in the sense that there is no program that will take your r2019b matlab and modify some l...

How to upgrade MATLAB R2020a

You cannot "upgrade" between releases, in the sense that there is no program that will take your r2019b matlab and modify some l...

2 days ago | 0

Answered

Why do I get this xlswrite error?

Either remove the keyword 'sheet' or else before the last input add the keyword 'range'. You can use positional arguments but as...

Why do I get this xlswrite error?

Either remove the keyword 'sheet' or else before the last input add the keyword 'range'. You can use positional arguments but as...

2 days ago | 0

| accepted

Answered

What is missing from MATLAB?

Ability to use a multidimensional logical array to substitute for multiple dimensions while still specifying other dimensions. ...

What is missing from MATLAB?

Ability to use a multidimensional logical array to substitute for multiple dimensions while still specifying other dimensions. ...

2 days ago | 0

Answered

Saveas Invalid Handle Error

edge() does not return a figure or any other type of graphic object. edge() returns a logical() array, and does not display the ...

Saveas Invalid Handle Error

edge() does not return a figure or any other type of graphic object. edge() returns a logical() array, and does not display the ...

2 days ago | 0

| accepted

Answered

Extract only numbers from a text file with Matlab

I recommend using regexp with named tokens and the 'names' option. For example parts = regexp(S, 'x="(?<x>[^"])"\s+y="(?<y>...

Extract only numbers from a text file with Matlab

I recommend using regexp with named tokens and the 'names' option. For example parts = regexp(S, 'x="(?<x>[^"])"\s+y="(?<y>...

2 days ago | 2

| accepted

Answered

How to sub in multiple vectors into a structure

vars = num2cell([o2; o5; o6; x5; dx; Fs]); Sol_struct.Ax = double(subs(Sol_struct.Ax, vars, Cell_matrix)); Cell_matrix would h...

How to sub in multiple vectors into a structure

vars = num2cell([o2; o5; o6; x5; dx; Fs]); Sol_struct.Ax = double(subs(Sol_struct.Ax, vars, Cell_matrix)); Cell_matrix would h...

2 days ago | 1