Answered
I have 100x73 double mat file as shown in image. I want to remove all zero values from this file and save it to a new mat file. How can I do it? Thank you.
It is not possible to have a numeric matrix that contains blanks. It is not possible to have a numeric matrix that contains a d...

3 days ago | 0

| accepted

Answered
issue with rgb2ind
RGB = imread('flamingos.jpg'); %% rescale image Scale_Multiplier = 4; rescale_size = [112,128].* Scale_Multiplier; RGB2 = ...

3 days ago | 0

Answered
How to solve an optimization problem with the objective function is a matrix ?
Each element of the matrix is effectively a separate objective, so in order to do this you would need to use a multi-objective o...

3 days ago | 0

Answered
How to write the following equation using matlab
syms U L C R t h(t) = 2*sin(sqrt(U*L - C*R^2)/(L*sqrt(2*L))*t) / (sqrt(C)*sqrt(4*L-C*R^2)) * exp(-t*(R/2*L)) Unfortunately y...

3 days ago | 0

Answered
How to extract specific struct data from multiple mat files? Please help. Thank you so much.
N = 5; ap_structs = cell(N,1); for K = 1 : N filename = K + "pbs0.mat"; datastruct = load(filename, 'ap_struct'); ...

3 days ago | 0

| accepted

Answered
Error using gather GATHER requires at least as many inputs as outputs.
You are invoking tall array's gather function, https://www.mathworks.com/help/matlab/ref/tall.gather.html The syntax for that ...

3 days ago | 1

| accepted

Answered
Restart Matlab after renewing my license
Save any needed files. Then quit and then launch MATLAB again.

3 days ago | 0

Answered
How can I decrease intensity levels?
newImg = imresize(Img, size(Img, 1:2)-20);

3 days ago | 0

Answered
How to use imcrop with [ ]
Use rescale() of the data before cropping.

3 days ago | 0

| accepted

Answered
Comparing large sparse matrices for differences close to machine precision
[r1, c1, s1] = find(k1); [r2, c2, s2] = find(k2); rc1 = [r1, c1]; rc2 = [r2, c2]; [~, ia, ic] = intersect(rc1, rc2, 'rows');...

3 days ago | 1

| accepted

Answered
How to make M into a symsfun?
% This program computes for the Tangent Line / Normal Line of a curve % about a given point %define x for sy...

3 days ago | 0

Answered
Why ' gpos.m' is not working( ginput with posiiton of the current axes)?
Change app.tfig = [app.tfig, figure('Name', 'points','WindowButtonMotionFcn',@gpos)]; to app.tfig = [app.tfig, figure('Name',...

3 days ago | 0

Answered
What is LD_LIBRARY_PATH when setting up matlab?
LD_LIBRARY_PATH is a standard UNIX (POSIX) environment variable that affects the directories searched by the linker at run-time ...

3 days ago | 0

Answered
ScatteredInterpolant for Surface Extrapolation
scatteredInterpolant() does not do any kind of surface fitting. The default fitting option that it uses, the one you are getting...

3 days ago | 1

Answered
What is the minimum supported .net version for MATLAB R2018b ?
https://www.mathworks.com/help/releases/R2018b/matlab/matlab_external/system-requirements-for-using-matlab-interface-to-net-.htm...

3 days ago | 0

Answered
Error using classreg.learning.internal.classCount (line 31) You passed an unknown class '0.7641' of type double.
load humanactivity rng('default') %for reproducibility Partition = cvpartition(actid, 'Holdout', 0.10); trainingInds = trai...

3 days ago | 0

Answered
When execute the below code ? the error message appear 'Index exceeds the number of array elements'?
Using extractBetween() as suggested by @Jérôme is the approved way to work with characters inside strings. But you can also go t...

3 days ago | 1

Answered
How to generate histogram from a given (x,y) dataset?
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1131165/xy.xlsx'; data = readmatrix(filename); bar(...

4 days ago | 1

Answered
why MATLAB code take a long time { parfor x=1:length(rb) }
parfor x=1:length(rb) That is 42 work groups, to be divided up among however many cores you have for ru=0:0.01:4 401 ru itera...

4 days ago | 0

Answered
app designer: how to index through multiple UIAxes
app.plotHandles = gobjects([app.UIAxes_1,app.UIAxes_2,app.UIAxes_3,app.UIAxes_4,app.UIAxes_5]) The gobjects() function only acc...

4 days ago | 1

| accepted

Answered
Can you write a code for the following hyperbolic function?
Your sqrt() was ending too early. I made exactly the same mistake when I typed into my own session. format short g y_m_vals = ...

4 days ago | 1

Answered
get the numerical values from char
data = cell2mat(textscan(val, '%f', 'HeaderLines' ,17)); The 17 here is my estimate from counting blank lines. I would have bee...

4 days ago | 0

Answered
Convert a cell in a field from string to number
I suspect it is because the data is currently in string format x y z all need to be numeric for plot3() to work. However, tdfr...

4 days ago | 0

Answered
Incompatible Array Size/Mathematical Input Error
x = 3.*[8 7 4]; V = [8 7 4]; R = [8 7 4]; Eo = V./(2.*R); r = ((2.*R) + x)./(2.*R); B = acosh(r); syms m n integer S = x....

4 days ago | 0

Answered
textscan - import the k-th out of n columns and ingore the 1st row which contains column names
cols_to_keep = [17, 83:85]; %for example fmt = repmat({'%*f'}, 1, NumberOfColumns); %read but do not sae fmt(cols_to_keep) ...

4 days ago | 0

| accepted

Answered
Would you tell me the code for Fisher Pearson skewness?
FPskewness = sum(x - mean(x)) / numel(x) / std(x).^3 You would need to be more rigourous if you wanted to handle non-vectors.

4 days ago | 0

Answered
How to force textscan to include the custom EOL character
No, textscan() will always eat the EndOfLine delimiters. One approach: Keep a buffer of unprocessed text, initially [] while ...

4 days ago | 1

| accepted

Answered
Obtain Values Greater Than Threshold For a Duration
%Fs is sampling frequency, use your actual frequency instead of the %hard-coded one I give here Fs = 24000; threshold_durat...

4 days ago | 1

| accepted

Answered
Multiple Outputs of a function into a single vector
There is no functional solution in MATLAB. The only way to capture multiple outputs is an assignement statement. The assignment ...

4 days ago | 1

| accepted

Answered
How to enable zooming only when the scroll is rotating?
No, there is no way to do that. Mice do not actively exchange state both directions with computers. There is no way for a com...

4 days ago | 0

| accepted

Load more