Answered
Error: Cannot create output file
The error message means, that the file "newfile.png" cannot be created in the current folder. Either this file is existing alrea...

9 years ago | 5

| accepted

Answered
what does the error mean for "Function definitions are not permitted in this context."?
You can save code in two kind of files: scripts and functions. Functions start with the keyword "function" and if this is missin...

9 years ago | 0

Answered
I have created a loop to which I needed an 'input' . When I run it, the system shows "error using 'input'". I can't figure out my mistake.
The problem is hidden in "When I run it". How do you start the code? Safe it to an M-file and call it from the command line. The...

9 years ago | 0

Answered
bitsrl of a hex value
With some guessing: In = 'AF' a = sscanf(In, '%X'); b = bitshift(a, -2); Out = sprintf('%X', b)

9 years ago | 1

| accepted

Answered
Delete unnecessary subdirectory rmpath and addpath ( automatically Set Path)
Why do you append all folders generated by |genpath| only to remove some folders afterwards? Simply clean up the list of folders...

9 years ago | 0

Answered
Will there be shared memory?
This is the public forum. We cannot know the plans of MathWorks. You can use the "Contact Us" link to send them an enhancement r...

9 years ago | 0

| accepted

Answered
loglog plot command not working,gives linear plot
At first a simplified version of your code: function f_plot(sr) load(sr); % BAD idea, now it is not clear, which varia...

9 years ago | 0

Answered
How can I index consecutive values in an matrix that corresponds to 25% of the maximum of each column?
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength>: nA = size(A, 2); maxA ...

9 years ago | 0

| accepted

Answered
mark points on graph
Example: x = 1:10; y = rand(1, 10); s = [2,4,8]; % Indices of points to mark plot(x, y); hold on plot(x(...

9 years ago | 0

Answered
What wrong with this code guys?,help me please!
Notes: The "clear temp" is a waste of time, because you define the variable "temp" in the next line again. Then the former value...

9 years ago | 0

Answered
Help search index not found
See <https://www.mathworks.com/help/matlab/ref/builddocsearchdb.html> for re-creating the search database. Maybe this helps you ...

9 years ago | 1

Answered
axis command fails for log scale
It is not the |axis| command, which fails, but the |axes| contains the wrong values. ax = axes; plot([1 2], [1 2]); a...

9 years ago | 2

Answered
get the intersection points in the graph
I have answered this question today already. Please read your other thread: <https://www.mathworks.com/matlabcentral/answers/377...

9 years ago | 0

Answered
How to calculate a percentage of similarity between two arrays
There are a lot of different ways to define similarity. One idea is the Euclidean distance: Data = rand(10000, 10); Key ...

9 years ago | 1

Answered
is it ok to have a function where the input is the output
A nice function, which has at least a use, is the swapping of two variables: function [b, a] = swap(a, b) % This functio...

9 years ago | 0

Answered
Copying from one column to another and assign increasing name (string+number)
Maybe: C = {'x'; 'x'; 'y'; 'x'; 'y'; 'x'; 'x'; 'x'; 'x'; 'y'}; idx = strcmp(C, 'x'); C(idx) = strcat(C(idx), ...

9 years ago | 0

Answered
How to compare rows of an array with other rows?
The question is not clear, but I guess a code which produces the output: array = {[1,2,3,4,6,13,18,9];[13];[12,1,2,5];[3,4...

9 years ago | 0

| accepted

Answered
draw a line parallel to x-axis
line([0.2, 19.8], [1, 1], 'Color', [1,0,0]); If you have a question about drawing a "line", look into the documentation: ...

9 years ago | 2

| accepted

Answered
Sub values into multiple rows and columns simutaneously
Replacing 3 elements is not time consuming and the show code is very efficient. If run time is critical, you are working on anot...

9 years ago | 0

| accepted

Answered
Get gui to run a command when getting an error from trying to rewrite a file that is open, or the user cancel during save.
... Your code to make the GUI parts invisible comes here Folder = fullfile(handles.workingPath, 'Mydata'); % FULLFILE ...

9 years ago | 0

| accepted

Answered
Testing to see how this works
There is no |this| keyword in Matlab. Loren has explained this (I mean the absence of |this|): <https://blogs.mathworks.com/l...

9 years ago | 1

| accepted

Answered
could anybody help me how to solve the error in the following code
The old problem of global variables. global q; ... CP{q} = C_part; Now it seems like your q is not a scalar. It i...

9 years ago | 0

| accepted

Answered
Currently I have MATLAB version 2006b and I want to upgrade it to 2017b. Can I jump directly from 2006b to 2017b ?
Come of the built-in functions have changed their behavior since 2006b: * |fread| does not support VAX-D files anymore * |un...

9 years ago | 1

Answered
How do features from 'license' correspond to names from 'ver'
You have to rely on something. Because this is not trivial, when the names or key changes, writing your own function might be th...

9 years ago | 0

Answered
Count element of cell array that are names
Do you mean this: % Join all cell strings: c = cat(1, type{:}); % Create list of searched strings: Pool = sprint...

9 years ago | 0

Answered
I have some problem about showing path of a picture in guide! how can i do this? Please help me! thank you very much!
[filename, filepath] = uigetfile('*.*', 'MultiSelect', 'on'); if isequal(filename, 0) disp('User aborted file choosing...

9 years ago | 0

Answered
Dynamic comments on variables?
This sounds like a magic meta programming. I recommend to avoid such smart tricks and keep comments in the source code as usual....

9 years ago | 1

| accepted

Answered
Can i install matlab 2014 on windows 7 ultimate OS?
You can simply ask an internet search engine to find the system requirements. Useful terms: "Matlab 2014 system requirements". Y...

9 years ago | 0

Answered
How to replace negative elements in a Matrix with zeros?
Or: A(A < 0) = 0

9 years ago | 18

Answered
Using gpuArrays to speed up a simulation (utilizing an NVIDIA GPU)
|rand(1, 1000)| is created on the CPU and than copied to the graphics board. This communication is slow. Better create the rando...

9 years ago | 0

| accepted

Load more