Answered
I want to make 4 clusters using k mean clustering and for each of the 4 clusters i want to set centroid initially and then accordingly make the cluster. how can I.
https://www.mathworks.com/help/stats/kmeans.html numclusters = 4; Initial = numeric matrix that is numclusters x number of co...

4 years ago | 0

Answered
Brute force for finding optimal value
https://www.mathworks.com/matlabcentral/answers/1682659-brute-force-for-finding-optimal-value#answer_928834 Brute force is *d...

4 years ago | 0

| accepted

Answered
Dont understand this error- unable to resolve filename
Either you do not have DSP System Toolbox installed or else you are using 2008 or earlier MATLAB.

4 years ago | 0

Answered
Unrecognized field name "data".
ma = load (strcat(data_dir , saveName(n, 2))); Whatever file is getting loaded by that does not contain a variable named "d...

4 years ago | 0

| accepted

Answered
On R2018B release,overlay different colormaps for same axis
No existing version of MATLAB supports multiple colormaps on the same axes. You need to do one of: * use multiple axes (yy...

4 years ago | 0

| accepted

Answered
Brute Force for finding optimal value?
Brute force means to try every possible solution, at least until an acceptable solution is found. Now suppose you have the fu...

4 years ago | 3

Answered
Error Updating Function Line and Unable to find symbolic solution Warnings
You are solving the functions one at a time instead of as a system, and you are not doing any back-substitution. You are doin...

4 years ago | 0

Answered
Can matlabonline trial version run a program that requires around 40-50gb of memory for computation.
NO. MATLAB Online is restricted to 5 Gb. No, trial version is not limited in that way, but MATLAB Online is fairly limited. Ye...

4 years ago | 1

| accepted

Answered
PLEASE HELP, INTEGRAL MATLAB Error using integral2Calc>integral2t/tensor
qmin=@(p)y^2 That looks in the workspace to find the current value of a variable named y and stores that value internally in th...

4 years ago | 0

Answered
How to interchange entries of a n array?
1- Is there any other faster way to do that? There are potentially overlaps: a row might get moved in and moved out again. Ther...

4 years ago | 1

| accepted

Answered
I need help in finding the right sequence of rows
A = [2 3 2 5 6 1]' [~, order] = sort(A)

4 years ago | 0

| accepted

Answered
How to do iteration using while loop?
k = 1; while true do the stuff for step 2 if s*(k+1)-s*(k)<=0.01 && b*(k+1)-b*(k)<=0.01 && X(k+1)-X(k)<=0.01; break; ...

4 years ago | 0

Answered
how to solve for fsolve
y = sym('y'); That is a scalar symbol eqn = (1 + y).^L_i - (1 + gamma_i ./ (y + 1)).^L_j; We cannot tell how many...

4 years ago | 0

Answered
How do I differentiate the functions in parfeval?
Create a cell array of function handles. Index into it by the parfor index. It is possible to get the id of the worker, but y...

4 years ago | 1

| accepted

Answered
GPU MEX not compatible with GPU with compute capability '3.0'?
<https://www.mathworks.com/help/releases/R2021b/parallel-computing/gpu-support-by-release.html> R2020b was the last release w...

4 years ago | 0

| accepted

Answered
Synthesising a different kind of discrete signal
You would vectorize. For example, format long g t = 1 : 10 y = exp(-t/sqrt(7)+sqrt(5)) stairs(t, y)

4 years ago | 0

| accepted

Answered
Delete element of structure if its value is not contained in array (string)
mask = ismember({A.Chan.label}, label); A.Chan.label = A.Chan.label(mask);

4 years ago | 0

| accepted

Answered
draw oriented rectangle around a blob
See https://www.mathworks.com/help/images/ref/bwferet.html Note that if you are looking for the angles then regionprops() 'Ori...

4 years ago | 0

Answered
fprintf's at beginning and end of a function called witihin parfor loop
Use a parallel data queue to send messages from the workers back to the client to print. See https://www.mathworks.com/matlabce...

4 years ago | 2

| accepted

Answered
For loop vector issue
e_values = 0:0.01:w; num_e = length(e_values); Sbvec = zeros(num_e, 1); for e_idx = 1 : num_e e = e_values(e_idx); ...

4 years ago | 1

Answered
convert a time series into a real time animated plot
Times = time2.Time; Data = time2.Data; N = 10; %at a time -- one at a time is very slow nsamp = length(Times); h = animate...

4 years ago | 0

Answered
Change color of specific bits Imagesc(), Image()
Yes. See https://www.mathworks.com/matlabcentral/fileexchange/24093-cprintf-display-formatted-colored-text-in-command-window

4 years ago | 0

Answered
Split array into subarrays
X = your 200 x 1 array A = X(1:50); B = X(51:100); C = X(101:150); D = X(151:200); or, typically better, X = your 200 x 1 ...

4 years ago | 0

| accepted

Answered
Change device in MATLAB educative license
Deactivate on the old one and then activate on the new one; https://www.mathworks.com/matlabcentral/answers/100663-how-do-i-de...

4 years ago | 0

Answered
How can I save variables from the loop?
% program before that, then fieldname = "avg_results_" + day_number; temp = struct(fieldname, av3); save("YourFileOfResults...

4 years ago | 0

Answered
Error using piecewise function
When you call piecewise(), the first parameter to piecewise() must be symbolic. Your N is very likely numeric, so your h = 1/N ...

4 years ago | 0

| accepted

Answered
How can I see the full matrix when I use spdiags() ?
full(spdiags(TheSparseMatrix)) ??

4 years ago | 1

| accepted

Answered
Is there any solution to stop using mfile or script to run after a specific time or after a specific times run?
Mathworks does not provide any method for imposing licensing on software. Licensing is difficult to do well. For example for ...

4 years ago | 0

Answered
"Run-time error '429': ActiveX component can't create object" error when I try to use Spreadsheet Link with Excel?
MATLAB Runtime (MCR) is like Visual Studio Runtime library: a support package that cannot do anything itself. You need to ins...

4 years ago | 0

| accepted

Answered
Identifying a pair of numbers across two arrays that match - ignores any duplicates
[~, px] = ismember(x, valuex) ; [~, py] = ismember(y, valuey) ; t = setdiff(intersect(px, py), 0); t is now the list ...

4 years ago | 0

| accepted

Load more