Answered
Is it possible to run Matlab Deep Learning Toolbox functions in Octave?
No. For 2 reasons: It is not 100% compatible (I'm sure!). The license conditions will not allow this. If you do have a license...

3 months ago | 1

| accepted

Answered
Min of each column of a sparse matrix?
For large inputs a loop is faster than accumarray: X = sprand(2000, 20000, 0.2); tic; for k = 1:10 [ii,jj] = find(X); ...

3 months ago | 0

Answered
simplify my script?
Move all repeated work out of the loops. In your case: % Load data ncfile = 'Temperature.nc'; months = {'January'...

3 months ago | 0

| accepted

Answered
generate sine waves that appears after one another
figure; % Insert this: axes('NextPlot', 'add'); % Equivalent to: hold('on') ... Otherwise the plot() command clears it...

3 months ago | 0

Answered
Function not processing dat for each element in array
Remember, that Matlab's IF condition must be a scalar. If you provide n as a vector, the line: if n >= 50 implicitly perfo...

3 months ago | 1

Answered
Is there any equivalent keyword 'goto' in matlab not in simulink but in matlab coding
No, there is no GOTO in Matlab and it should be avoided strictly in good code. Maybe: function YourFunc n = 123; % ??? for ...

3 months ago | 0

| accepted

Answered
Storing output of function file in workspace
Nested nested functions - brrr. What about: t = 0.3:0.1:6; ? You store the variable Cfit in the workspace of the function Pa...

3 months ago | 0

Answered
Readmatrix in struct using parfor
Fields names cannot contain the charcater '#' . fld = sprintf('File_%d', i); Data.(fld) = readmatrix(Files2Read{i}); ...

3 months ago | 0

| accepted

Answered
Need some help with re-formating a text.file using MATLAB?
Actually all you want to do is to replace the string a = sprintf('''10''\n') % by b = sprintf('''10'' good ') and c = sp...

3 months ago | 0

Answered
how to make timer callback function?
app.something = 'hello'; tt = timer('Name','Test','Period',1, ... 'ExecutionMode','fixedSpacing','BusyMode','drop'); tt.Ti...

3 months ago | 0

| accepted

Answered
Load MatLab with Network License when Network is Unavailable
A network license is designed to work inside the specified network only. This is its nature. So you are asking for a break of th...

3 months ago | 0

Answered
is it possible to use "for loop" for matrix?
X1 = zeros(1,6); X2 = zeros(1,6); for k=1:6 for j=1:n X1(1,k)=(j^k)+X1(1,k); X2(1,k)=(j^k)+X2(1,k); ...

3 months ago | 1

| accepted

Answered
How to make 3 arrays (Test , Test2, Test3) that are of different lengths into one matrix?
A matrix is a rectangular list of elments. This means, that all rows must have the same number of elements. Either fill the sho...

3 months ago | 1

| accepted

Answered
how to use multiple 'for loop' for one function?
Please post the complete error message, if you mention an error. This message contains the information, in which line the proble...

3 months ago | 0

| accepted

Answered
Iterating inside an iteration loop, while loop
This is not a bug, but useful for efficient code: 10^(-4) is an expensive power operation while 1e-4 is a cheap constant. if Z...

3 months ago | 0

Answered
Compatibility of code when updating Matlab licence
See: https://www.mathworks.com/support/requirements/matlab-system-requirements.html R2021b supports Windows 7 SP1, while Win7 i...

3 months ago | 1

Answered
Vectorize comparing a column vector in a matrix to all other vectors in the matrix.
Why do you want to vectorize this code? I assume, this will cause a slow down, because this creates large temporary array, which...

3 months ago | 0

| accepted

Answered
Share global variables between windows App Designer
Global variables are a mess in every case. Sending the data through a well defined interface would be much better. Do not use "...

3 months ago | 0

| accepted

Answered
Image resize without losing quality of image ? (urgent Issue)
Of course reducing the number of pixels reduces the resolution. But you can reduce the artifcats: imresize(Img, [640,427], 'lan...

3 months ago | 0

Answered
how to delete all row contain a 1's and how to delete a column contain 1's. Q=[3 1 1 0 0 1;1 3 1 0 1 0;1 1 3 1 0 0;0 0 1 3 1 1;0 1 0 1 3 1;1 0 0 1 1 3]
Following your instructions: "Actually firstly i want to deleted the all columns that contain a 1's in first row. Then we check ...

3 months ago | 0

| accepted

Answered
Can I define my own special characters?
No, you cannot treat special characters in Matlab as functions. Of course, you can create a pre-processor, which replaces such ...

3 months ago | 1

| accepted

Answered
Is it possible to group some strings of code, in order to shorten the visualization of the script?
You do not mean "strings". Strings are characters enclosed in double quotes. With "open and close groups" you mean the folding c...

3 months ago | 1

| accepted

Answered
Make Variable Names in a table numbers
Header are strings, not numbers. You cannot use numbers to be a header. allData = reshape(1:64, 8, 8) t = array2table(allData)...

3 months ago | 0

| accepted

Answered
mat1(mat2) = mat1 assignment
The pattern is trivial. I do not understand, what is unclear: t1 = [ 0 1 2 3 4 5 6 ]; t2 = [ 7 6 5 4 3 1 1 ]; t1(t2) = t1; ...

3 months ago | 1

| accepted

Answered
Why doesn't Matlab recognize my data format?
a = datetime('28/02/2018', 'InputFormat', 'dd/MM/uuuu') b = datetime('29/02/2018', 'InputFormat', 'dd/MM/uuuu') % FAILS: % Un...

3 months ago | 0

Answered
minimal path sum in a MxN matrix from top left to bottom right with only Down and Right Moves available
A brute-force approach: M = 8; N = 8; X = randi([0, 1], M, N); % Now you need M-1 moves down and N-1 moves to the right. ...

3 months ago | 0

| accepted

Answered
Stop an infinite loop with a key
You delete the waitbar in the first iteration: delete(hWaitbar); Remove this line. or move it behind the loop. I cannot imagi...

3 months ago | 0

| accepted

Answered
Href hyperlink, how to escape double quotes " ?
I'm curious: % [UNTESTED] [TYPO FIXED] disp(['<a href="matlab:system(', ... 'strrep(''explorer.exe /select, $C:\My folde...

3 months ago | 0

Answered
How to have different scales in the same x axis?
Set the XTickLabels accordingly with fake XTicks: X = [1,2,3,4,5,6, 100]; Y = rand(size(X)); axes('NextPlot', 'add', 'XTick',...

3 months ago | 0

Answered
Grouping the Elements of the Array
x = rand(897880, 1); nx = numel(x); len = 300000; tile = [repelem(len, floor(nx / len)), rem(nx, len)] xC = mat2cell...

3 months ago | 0

Load more