Risposto
How to remove all volumes that only have zeros in them from a 5D array?
Start with using loops at first: data = randi([0, 1], [2, 10, 112, 240, 30]); % Some test data for i3 = 1:size(data, 3) ...

7 mesi fa | 1

Risposto
Dynamical plotting acceleration during loop calculation
Without seeing the code, it is hard to guess the reason of the slow down. I dare to guess boldly, that you insert new objects in...

7 mesi fa | 1

| accettato

Risposto
access matlab figures by opening them with a mouse while a matlab terminal application is still running
This took 4 minutes for writing: function MainGUI FigH = figure('Name', 'Main GUI', ... 'MenuBar', 'none', ... ...

7 mesi fa | 0

Risposto
I work on the project fake currency detection by MATLAB but I get a error i try to solve but i dont find solution
As I've written already, the problem is here: rectangle('Position',A(n, :), ' EdgeColor', 'r', 'LineWidth',4) % ...

7 mesi fa | 1

| accettato

Risposto
Fastest Way to Keep the last N Outputs of a Loop in a Matrix
If you do not know the number of iterations in advance, a circulare buffer is more efficient than shrinking an expanding an arra...

7 mesi fa | 0

| accettato

Risposto
Mean of every n number of doubles in a cell
I've reduced the test data size to 30x30 matrices - use the original sizes for your implementation: T = squeeze(num2cell(rand(3...

7 mesi fa | 0

| accettato

Risposto
access matlab figures by opening them with a mouse while a matlab terminal application is still running
What does "make some plots" exactly mean? .fig-files? PNG-files with raster copies of diagrams? What is the reason that they can...

7 mesi fa | 0

Risposto
I keep getting a "convenc" error. Line 88. Could be "varargin" missing argument? Not sure.
The line is incomplete: encoded = convenc(msg,trellis,); % ^ ???

7 mesi fa | 0

Risposto
convert all .mat files to .wav format in a folder at once
No, this cannot work "at once", but one file after the other in a loop. See e.g. FAQ: How to process a sequence of files. It is...

7 mesi fa | 0

Risposto
File too complex to analyze, function maybe too large?
Try a simplified version: Calculate the function directly instead of creating a huge function handle. Use constants for the mo...

7 mesi fa | 0

Risposto
How to create a vector for multiple frames of data in rows and columns?
The actual question is: "I need to create a vector that corresponds to the time of each frame starting at 0" What about: t = l...

7 mesi fa | 0

Risposto
How to read a specially structured data file
[fid, msg] = fopen('test.5p'); assert(fid > 0, '%s', msg); C = fscanf(fid, '%g', inf); % Read all in one block fclose(fid); ...

7 mesi fa | 2

Risposto
how to reduce the size of array as small as the smallest array to have them in one matrix
There are several possibilities: Fill the shorter arrays with zeros or NaNs on the top, bottom or both. Crop the longer arrays...

7 mesi fa | 0

Risposto
How to make a folder, call functions from it, and then go back to the current directory
Changing the current directory is not useful in stable code, neither to process data nor to run Matlab functions. The addpath c...

7 mesi fa | 1

Risposto
Why is my function not working?
Avoid using the name of the function as name of the output. This is confusing only. Which is the failing line? In this line f35...

7 mesi fa | 1

| accettato

Risposto
How to put non repeated elements of a symmetric matrix in a row vector?
You have hidden an index in the name of the variables. This was a bad idea. It is time to re-organize your data. Are all these ...

7 mesi fa | 1

Risposto
can we share our original code here,?
The FileExchange is a suiting location for sharing code, while the Answers forum is not. Plagiarism does only occur, if the cop...

7 mesi fa | 0

Risposto
how to plot subfigures in one figure like this image?
subplot calls axes with specific 'Position' proerpties inside. You can do this directly also. ax1 = axes('NextPlot', 'add', 'Vi...

7 mesi fa | 0

| accettato

Risposto
why two function in separate m.file not in one ?
If you need a function inside another one only, you can store it in the same M-file. If other function should have access to the...

7 mesi fa | 0

Risposto
Setup alias command in Windows.
As far as I understand, Matlab does not run in the command shell under Windows. Maybe the -batch or -wait flags are useful. See...

7 mesi fa | 0

| accettato

Risposto
How to create function handle using random output
Maybe: maximand = @(x) f([p_bar, q_bar, r_bar, x(randperm(3, 3))])

7 mesi fa | 0

Risposto
use two indexes at the same time in a for loop
for i = 4:5 & k = 1:2 This is pure guessing. While some human can understand, what you want, if you apply such trivks inspo...

7 mesi fa | 1

Risposto
How do I add a left/right axis to a plot in matlab 2013a
You find several corresponding FileExchange submissions: https://www.mathworks.com/matlabcentral/fileexchange?q=plotyy plotyy ...

7 mesi fa | 0

Risposto
WindowButtonMotionFCN callback slow down the application
Try if rejecting repeated calls solve the delay. See e.g. https://www.mathworks.com/matlabcentral/answers/570829-slow-sizechange...

7 mesi fa | 0

Risposto
how to do break the program written in script file and execute
Breakpoints are a good idea: Simply click on the bar on the left side of the editor. You will see a red dot occurring there. Mat...

7 mesi fa | 0

| accettato

Risposto
Image processing of a binary image
w = 300; % Image size bigR = 140; smallR = 15; wantN = 40; % Number of small circles N = 0; center = zeros(...

7 mesi fa | 0

| accettato

Risposto
How can I get a variable that starts in t=0?
y(1, 1) = 500; % Set initial value before the loop for t = 1:249 % y(1, :) is defined already, so start at t=1, not t=0 ...

7 mesi fa | 1

Risposto
Most practical way to speed up calculations?
I've seen many examples in the forum, where the old and fundamental method of vectorization slows down the execution compared to...

7 mesi fa | 0

| accettato

Risposto
How to create 4D array of images
Maybe this is enough: List = dir('C:\ParentOf_A_B_C', '**', '*.gif'); Array = []; for k = 1:numel(List) img = imread(fu...

7 mesi fa | 0

Risposto
How to perform derivative of a random signal without finite difference schemes?
You can try a Savitzky-Golay-Derivative filtering: https://www.mathworks.com/matlabcentral/fileexchange/30299-savitzky-golay-smo...

7 mesi fa | 0