Answered
How to determine how many random numbers were generated, using Mersenne twister?
The direct solution is to modify the function joeblow1 and joeblow1 such, that they count the created random numbers. Another o...

3 years ago | 0

Answered
how i can fix the problem of isPrimitiveRoot ?
Open the documentation: doc isprimitiveroot or online: https://www.mathworks.com/help/symbolic/isprimitiveroot.html Scroll d...

3 years ago | 0

| accepted

Answered
How to extract data from this chunk of data
c = '77es-78es-79es-79es-80es-81es-82es-83es-144es-145es-146es-147es-1'; m = strfind(c, 'es'); d = c(m(1):m(end)-1); d = st...

3 years ago | 1

Answered
Unrecognized function or variable 'lof'.
Do you have the Statistics and Machine Learning Toolbox installed and licensed? If not, you cannot access functions of this tool...

3 years ago | 0

Answered
How to make a while loop to repeat multiple times with different values of variable?
Simply add a loop to modify q: for q = 0.5:4 t_in_before=19; t_out=-1; time = 0; while t_in_before > 5 ...

3 years ago | 0

| accepted

Answered
Unable to perform assignment because the size of the left side is 1-by-3 and the size of the right side is 7-by-3.
"Unable to perform assignment because the size of the left side is 1-by-3 and the size of the right side is 7-by-3." This error...

3 years ago | 0

Answered
Can anyone identify the error? and correct it.
Avoid an overkill of parentheses: Ip=(I0)+((p*I01)+(p*(P-1)I02)/(2))+((P(p-1)(p-2)*I03)/(6))+((p(p-1)(p-2)(p-3)*I04)/(24)) % ...

3 years ago | 0

Answered
Eliminate a for loop to increase speed
N = 2; L = 2; T = 1; a = [1 1i; -1i -1]; nplq = int8(de2bi((0:2^(N*L)-1),'left-msb')); % [0 0 0 0; 0 0 0 1; 0 0 1 0;...

3 years ago | 0

| accepted

Question


List of all functions an their toolboxes
Is there a way to get a list of the names of all toolbox functions? If I publish a toolbox, I want to avoid conflicts with Matl...

3 years ago | 1 answer | 0

1

answer

Answered
GUI handle empty after using some scripts
Running a pile of scripts impedes the debugging massively, as you can see. Any of the scripts can be responsible for overwriting...

3 years ago | 0

| accepted

Answered
How to enable multi-core CPU processing during MATLAB code running?
It depends on the code. Many functions are multithreaded and use more cores for large inputs. This applies e.g. to sum(), filter...

3 years ago | 0

Answered
Why this gives error?
This is the failing function: function [x,fval,gfx,output] = main(varargin) [x,fval,gfx,output] = hPSO1(@main3, 4, options, ...

3 years ago | 0

Answered
Quaternions Computation Time too long
While the multiplication with the rotation matrix calls an optimzed BLAS library directly, rotatepoint is a function, which call...

3 years ago | 0

Answered
Create a binary image from a 2-dimensional binary [0 1] matrix
What have you tried? M = false(100, 100); M(26:50, 76:100) = true; % The black rectangle Instead of setting all pixels to bl...

3 years ago | 1

Answered
I wanna make a .mat file
In Matlab this is easy: data = magic(4); % Arbitrary test data save('file.mat', 'data')

3 years ago | 0

Answered
Monospaced Font seems different in different Matlab versions...
The font, which is used by the generiv name "monospaced", changes between Matlab versions. I do not know, why MathWorks decided ...

3 years ago | 1

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
"But LFP1_t ed LFP2_t are both two vectors of 1000x1." - yes, of course, but the left side of the assignment correlation(t) is a...

3 years ago | 0

Answered
How to copy 30K images from folder to another according to the names in train and test text listes
With some guessing: source = 'D:\Dataset\NUSWIDE-Obj\imagesnus30k'; dest = 'D:\Dataset\NUSWIDE-Obj\Images30K'; tr = textr...

3 years ago | 0

| accepted

Answered
Working with large numbers of vectors
Of course: If all vectors have the same size, concatenate them to a matrix. How are the 5000 vectors stored currently?

3 years ago | 0

| accepted

Answered
Accessing each matrix in a cell array of size ~8GB and filter it
A loop is the efficient solution. Simply try it. If you have >= 16 GB of RAM, this array should be processed without problems. ...

3 years ago | 0

| accepted

Answered
the convolution function i wrote doesn't work for the big arrays
Pre-allocation is important, if you work with large arrays. Example: x = []; for k = 1:1e6 x(k) = k; end In each iterat...

3 years ago | 0

Answered
Matlab GUI elements disappear on newer version of Matlab
The uibuttongroup hides objects, which have been created before in modern Matlab versions. Set a position of the uibuttongroup'...

3 years ago | 0

| accepted

Answered
Identify lines that have a repetition (unique function)
data = [ 2.3300000e+02 3.5300000e+02 1.4912281e+00 2.3300000e+02 3.5200000e+02 1.4912281e+00 3.5300000e+0...

3 years ago | 0

Answered
How Do I Replace Numbers with Alphabets
The solution is trivial: Simply write it down using CHAR vectors (not strings, which are enclosed in double quotes): n = 'ABCDE...

3 years ago | 1

Answered
Matlab energy consumption greater than charger?
This is not a problem of Matlab, but your powersupply is too weak. Is it the original one delivered with the laptop? If so, it m...

3 years ago | 0

Answered
addPath does not take a vector from genpath
According to the documentation https://www.mathworks.com/help/matlab/ref/matlab.project.project.addpath.html addPath() takes one...

3 years ago | 0

| accepted

Answered
How to rotate this 2d matrix with some angle ?
To define a rotation matrix, you need one angle in 2D (rotation around the Z axis) one angle and an axis of rotation in 3D on...

3 years ago | 1

Answered
mask a matrix based on values in two arrays
n = 1e4; u = floor(rand(10,1)*100); v = floor(rand(10,1)*100); tic % Original version: [x y] = meshgrid(linspace(0, 100, ...

3 years ago | 0

| accepted

Answered
Do not use the for loop to calculate the first number greater than 0 in each line
x = randn(10, 10) y = x.'; % Required for the last step y(y3==1) y1 = y > 0 y2 = cumsum(y1) % Now a row can contain mult...

3 years ago | 1

| accepted

Answered
fprintf with complex numbers and ordinary arrays
This does not work without a loop. fprintf(' iteration number root estimates\n'); for k = 1:n fprintf('%10.0...

3 years ago | 1

| accepted

Load more