Answered
Convert string form to array form on Matlab
[1 2 3 4] --> '1234' : x = [1,2,3,4] s = sprintf('%d', x) '1234' ---> [1 2 3 4] : s = '1234'; x = s - '0'

7 years ago | 0

Answered
MATLAB is not plotting my constant value plot. Why so?
The code does draw some points. You see them, if you use a marker: plot(linspace(0,bw,10), PSDnin1, 'o') or with a line: plot...

7 years ago | 2

| accepted

Answered
Sorting a structure using Matlab2018
ten.cat = [7,2,4,1]; ten.cat = sort(ten.cat)

7 years ago | 0

| accepted

Answered
Is it possible to speed up this loop or avoid from using?
Start with vectorizing the innermost loop: dx = 1; dy = 1; xo = 5; f1 = 5; f2 = 10; f3 = 15; kx = 1:50; ky = 1:50; k = r...

7 years ago | 2

Answered
Close script kept in memory
What exactly does "code called from task scheduler" mean? How do you call the Matlab code? How do you define "exit in the task s...

7 years ago | 0

Answered
Why is arrayfun for GPU slower than normal operations
Of course arrayfun has a certain overhead. It is expected to run slower than calling the operators directly with arrays as input...

7 years ago | 1

Answered
how to split up column vectors into separate vectors from data
With a simple loop: Data = cat(2, [1:4, 1:6].', rand(10, 3)); % Some test data ind1 = [find(Data(:, 1) == 1); size(Data, ...

7 years ago | 1

| accepted

Answered
how to apply gaussian filter on images of type double in Matlab?
The error message means, that the function imgaussfilt is not found. Either you did not install the Image Processing Toolbox or ...

7 years ago | 0

| accepted

Answered
How to Permute the array with specific number?
You did not mention how the output should look like. Perhaps: b = [1,5,2,8,6,11,7,9,3,10]; keep = [1,2,6,7,9,10]; move =...

7 years ago | 1

Answered
How to save a variable computed inside ODE?
assignin is a bad programming technique. Producing variables remotely in another workspace is not clean. A better method is to l...

7 years ago | 1

| accepted

Answered
Matrix with repetitions of a vector
This sounds like a homework question, but you did not mention thuis explicitly. The solution is easy, but I do not want to solve...

7 years ago | 0

Answered
lowpass filter not filtering
As expected Matlab does filter the data, of course: t=0:3.13e-8:1e-3; y=sin(2*pi*200000*t); %noise y2=sin(2*pi*20000*t); %sig...

7 years ago | 0

| accepted

Answered
how to fix index out of bounds because size
You can be sure, that the size of T is [1x1], when you get this error message. If you "get [4,2]", the test was not valid. In a...

7 years ago | 0

Answered
How can i take pieces of this function by using ode23 matlab function?
function yprime = ydotfunc(t,y) % yprime(0)=y(1); % No, indices must be > 0 yprime(1) = y(2); yprime(2) = y(3); t3 ...

7 years ago | 2

Answered
MATLAB 2019a installation error
The profile folder "murat_000" looks like a temporary profile. Maybe this is a sandbox of Microsoft Edge? I used Firefox success...

7 years ago | 0

Answered
How can I combine data from multiple files and save as one file
If you want to join the contents of files, creating a figure is a useless indirection. Better join the files instead. Do the fi...

7 years ago | 1

Answered
Indexing errors with my function
Some of the indices are zeros. if M(i,j)>0 %swapping out -1 to 0s and assign to B1 B1s(i,j) = M(i,j); ...

7 years ago | 1

| accepted

Answered
I am unable to store data in an Object to use in a different callback function using GUI
The general idea is, that the handles struct is stored inside the figure's ApplicationData. If you have created a GUI with GUIDE...

7 years ago | 1

| accepted

Answered
How do I only get vectors out of the butter function?
I cannot confirm this. With standard Matlab functions, butter replies vectors. So check, if you use the official function: whic...

7 years ago | 0

Answered
How can I format numeric arrays that are too long
The format command affects only the display in the command window. This does not change the data or the method for the compariso...

7 years ago | 0

| accepted

Answered
Create dynamic array by comparing the new incoming variable value
Letting an array grow dynamically consumes a lot of resources. For small arrays with 100 elements, the costs are not severe, but...

7 years ago | 1

Answered
How do i get a function to open any text file on a computer
function Sensor_data() [fileName, filePath] = uigetfile('Choose some Sensor data:'); if isequal(fileName, -1) disp('User ...

7 years ago | 1

Answered
How to find first '1' in every row
Speed test: A = randi([0,1], 1000, 12501); tic; % MAX [~, B] = max(A,[],2); toc; >> 0.007 sec tic; % CUMSUM ...

7 years ago | 0

Answered
GUI on a scatter plot
I assume, this helps you to select a point: https://www.mathworks.com/matlabcentral/fileexchange/7594-click3dpoint Then you hav...

7 years ago | 0

Answered
How to print 1x50 array into a text file
Maybe: [fid, msg] = fopen(FileName, 'w'); assert(fid ~= -1, 'Cannot open file for writing: %s\n%s\n', FileName, msg); fmt = [...

7 years ago | 1

| accepted

Answered
Does Matlab work or run with Gnu-Lynux enviroment?
Du you mean "Linux"? Then see: https://www.mathworks.com/support/requirements/matlab-system-requirements.html => Linux

7 years ago | 0

| accepted

Answered
how to get the x value for a given y value?
You cannot expect that any of the points at t = -0.5:1/Fs:0.5 is exactly 0.5*max(x). Remember that you evaluate x at some time s...

7 years ago | 0

Answered
How programmatically know if an Update is installed for a particular matlab release?
Yes. See the output of version: 9.6.0.1114505 (R2019a) Update 2 With ver('Matlab') you get the version number only. But wi...

7 years ago | 1

| accepted

Answered
How to increase java heap memory in a dll?
I cannot check it with a compiled application. But inside Matlab you can hack the preferences file. At first check the current h...

7 years ago | 0

Answered
"Error using cell2struct Number of field names must match number of fields in new structure. Error in matrix_from_rasters (line 9) hdr = cell2struct(num2cell(hdr{2}),hdr{1});"
Use the debugger to examine, whats going on. Either set a breakpoint in the failing line, or stop Matlab automatically if an err...

7 years ago | 0

Load more