Answered
My code creates files, uses them and then deletes them. The deletion part does not always work
You cannot delete folders with limited user privileges, if they have been created with elevanted admin privilegs. A single file ...

9 years ago | 0

Answered
Question about logical calculation in matrix
The mistake is the |zeros| inside the loop, which resets the counter repeatedly: AA = [0.2 1; 0.3 1; 0.5 2; 0.9 2]; r1...

9 years ago | 1

| accepted

Answered
Problems with ode23s
[X(1) X(2) X(3) X(4)... X(5) X(6) X(7) X(8) X(9) X(10) X(11) X(12) X(13) X(14)... X(15) X(16) X(17)] ?? What about...

9 years ago | 0

Answered
Cannot choose isntallation folder for Matlab
This is the public forum with contributions of volunteers. MathWorks offers an official installation support and I recommend to ...

9 years ago | 0

Answered
MATLAB as a client and server / and the connection in between
Yes, this is possible. The Matkab engines can communicate over a serial connection, of the a TCP/IP connection or through files ...

9 years ago | 0

Answered
How to remove repeating rows without unique function?
I still do not understand, why you cannot simply sort the data. But this might be useful: *!!! UNTESTED !!!* function D...

9 years ago | 0

Answered
interpolation vector with a lot of duplicate values code on R2010a
You can emulate the modern |unique('stable')| by: function [AA, AI, BI] = UniqueStable(A) % Equivalent to: unique(A(:), ...

9 years ago | 1

| accepted

Answered
faster function than unique for cell arrays
It depends on the contents of the cell. If you are talking of a cell string, this could be faster for short (< 1000) elements: ...

9 years ago | 0

Answered
Is it possible to change the data reading order of the reshape function
No, |reshape| does not touch the order of the elements. Therefore this command is such fast. You are looking for |permute|, p...

9 years ago | 3

| accepted

Answered
How is it possible that Matlab still hasn't created a built in function that automatically inserts a title above a group of subplots?
Calm down. I'm using |text()| or |uicontrol('Style', 'Text')| for this purpose. This is fast and easy. I'm not one of your mi...

9 years ago | 3

Answered
Why plotting the first derivative of my function gets shrinked on its amplitud?
What is the derivative of |sin(a * t)|? a * cos(a * t) Try it: x = linspace(-2*pi, 2*pi, 100); y1 = sin(x); ...

9 years ago | 0

Answered
How I can randomly divide my data
[A, idxA] = datasample(X, round(0.7*n)); idxB = 1:n; idxB(idxA) = []; B = X(idxB); This is slightl...

9 years ago | 2

| accepted

Answered
can i download the power window simulation project and if yes.. how?
If you mean <https://www.mathworks.com/help/simulink/examples/power-window-control-project.html>: This example is included in yo...

9 years ago | 0

| accepted

Answered
My Modified regula falsi code has the same number of iterations and error value as the regular falsi code that I made. Why is this?
Let me ask the other way around: Why do you assume that the number of iterations must be different? Did you use the debugger ...

9 years ago | 1

| accepted

Answered
How to run a .p file on matlab 2015a, but .p file was created on 2007 version?
You have 2 problems: # The function has an old P-code format. This is a *warning* only, which means, that the function will n...

9 years ago | 0

Answered
How can I plot the discrete signal y(n) with input x(n) by using matlab command stem?
Perhaps you mean: x = @(n) log2(n + 1); % An anonymous function n = 0:6; y = (x(n) + x(n-1) + x(n-2) + x(n-3)) / 4;...

9 years ago | 1

Answered
Image changing to blue and yellow?
Your image of the moon is treated as indexed color image and the current colormap is applied. Convert it to an RGB image instead...

9 years ago | 0

Answered
Callback Function for update plot with multiple functions
See <https://www.mathworks.com/matlabcentral/answers/292993-continuous-slider-callback-not-updated-handles-in-callback-function>...

9 years ago | 0

Answered
file selection gui element
Do you know such a "file selection element" from other GUIs? Usually you call the dialog provided by the operating system, e.g. ...

9 years ago | 0

| accepted

Answered
Is MATLAB a compiler?
No, Matlab is not a "compiler", but an "interpreter". A compiler converts the source code to an executable file, which is not re...

9 years ago | 4

| accepted

Answered
Draw lines between two given sets of points
% Create some test data: S1 = cell(1, 5); for k = 1:5, S1{k} = rand(1, 3); end S2 = cell(1, 5); for k = 1:5, S2{k}...

9 years ago | 0

| accepted

Answered
I am trying to plot within a for loop, but it only plots the last value, as it's overwritting previous values
Why do you define |k| as global? It is a good programming practice to avoid globals, and here it is not clear, what the purpose ...

9 years ago | 0

Answered
Matlab fails to create plots when called from a function
Do you have any user-defined folders on top of the list of |path| folders? Then this can be the problem: This can happen if y...

9 years ago | 1

| accepted

Answered
How can a preserve hyperlinks on figures when saving them for use outside of matlab?
You can either export the figure to a HTML file, such that the diagrams appear as graphics and append the link manually. Or A PD...

9 years ago | 1

| accepted

Answered
Load data.mat with changing file name
function gama = testbd( Name) File = fullfile('C:\MYFILE\test', sprintf('%s.mat', Name)); FileData = load(File, 'A')...

9 years ago | 0

| accepted

Answered
Problems with plot command R2016a
I'm convinced that Matlab does not reject your data out of a mood. Whenever such _magic_ things happen, you can be sure, that yo...

9 years ago | 0

Answered
How can I create variable in workspace with a cycle for script?
And now as answer and not as a comment: Please read the document linked by Stephen very very carefully and if you are not con...

9 years ago | 0

| accepted

Answered
How I find rows with same elements but in flipped manner.
A = [1 2;3 4;2 1; 5 3;4 3]; As = sort(A, 2); % [EDITED], was: sortrows(A) Au = unique(As, 'rows');

9 years ago | 0

| accepted

Answered
timer causes drawing problem when loading a figure
A timer callback can change the current figure and current axes. How do you "load" the figures? Do the conflict appear inside th...

9 years ago | 0

Answered
Choosing the 3 closest points
The code inside the if LengthCPtoX > LengthTPtoX ... end block does not depend on the index k. Therefore I thin...

9 years ago | 0

Load more