Answered
Generating all possible pairs of polynomial?
The big problem is that you are throwing out most of your array. The method I use below does that as well, but much less so, mak...

8 years ago | 1

| accepted

Answered
Respond to text commands in command window without prompting for it
I have two suggestions: I don't really see how you would put that functionality in a CLI, so I'm going to suggest another rou...

8 years ago | 0

| accepted

Answered
replace multiple characters in a string with different characters
If you want to follow OCDER's advice, I would go for option 3. Using |strrep| in a loop is of course slower, but it allows much ...

8 years ago | 0

Answered
replace multiple characters in a string with different characters
You can enter cellstring inputs: >>line = 'I am ready to use MATLAB'; >>replaced = regexprep(line,{'r','u'},{'!','%'}); ...

8 years ago | 3

Answered
Find a nearest points in the matrix with a specific different value
Unless |n| is much bigger than 1e6, I would first calculate the outcome distance for each point and then take 1e6 samples from t...

8 years ago | 0

Answered
Hi, i am here to complete my project on a MATLAB GUI, but I have some syntax errors. Help me out.
|ginput| returns a decimal value, which you cannot use as indices. Use |round| to round your coordinates to integer values.

8 years ago | 0

| accepted

Answered
horizaontal lines in plots in a defined date
The code below should work for you. If it does not, please paste all red error text in a comment. t_special=[datetime(2016,...

8 years ago | 0

Answered
Plotting two adjacent y-value pairs with respect to the same x value
By now there might be documented method, but you can use the <https://undocumentedmatlab.com/blog/undocumented-scatter-plot-jitt...

8 years ago | 0

| accepted

Answered
I am having problem with input.
You learned a valuable lesson: don't shadow Matlab functions. You should write functions (or scripts) with names like |sum| or |...

8 years ago | 0

| accepted

Answered
How can I find the value in matrix
The code below should do it. M=[NaN 23 37 53 53 14 0.2998 0.4497 0.0996 0.2495 23 0.20...

8 years ago | 1

| accepted

Answered
Can I apply imtranslate to a 4D image?
The code below implements what I mentioned in my comment. It might also be the case that your 4D is actually a 3D in the same fo...

8 years ago | 1

| accepted

Answered
bsxfun(minus) vs normal minus
Have you read the documentation of <https://www.mathworks.com/help/matlab/ref/bsxfun.html |bsxfun|>? Input arrays, specifie...

8 years ago | 0

| accepted

Answered
How to randomly generate one non-zero element of each row from a matrix
There's probably a faster way, but the code below should work. A=[1 5 6 7 0; 2 0 0 4 2; 0 0 3 4 0]; A_cell=cellfun(@(x) ...

8 years ago | 0

Answered
Convert any datetime to english datetime
How about this? date=datetime(file.datenum,'ConvertFrom','datenum');

8 years ago | 3

| accepted

Answered
Is there any way to find it?
You can load the variables into a struct with the following syntax s=load('yourfile.mat'); Then you can get the variable...

8 years ago | 0

| accepted

Answered
Tiff library to export Tiff image uint32
I generated an example with the line below A=uint32(randi(uint32(inf),255,255)); Then, running your code resulted in thi...

8 years ago | 0

Answered
Store result of three nested for loops
You could also use <https://www.mathworks.com/help/matlab/ref/ndgrid.html |ndgrid|> to generate all combinations of loop paramet...

8 years ago | 0

Answered
[DISCONTINUED] MATLAB Answers Wish-list #4 (and bug reports)
Maybe it would be a good idea to ask for a confirmation before allowing users to answer their own question. Many people mistaken...

8 years ago | 5

Answered
How can i call class from a function?
You should really have a look at the documentation of how you write classes in Matlab, starting for example <https://www.mathwor...

8 years ago | 1

| accepted

Answered
Problem plotting function in GUI
Using the handles struct is very easy. It may seem hard to learn good practices, but it is much harder to unlearn bad practices....

8 years ago | 0

Answered
Find closest value to a constant in a multidimensional array column wise
The method I used below is to separate the parts the array you want to test from the rest of the array. As you can see in the |d...

8 years ago | 0

| accepted

Answered
Accessing cell array data every 2 columns and concatenating them
Easy with |cellfun|: %generate random data: A=cell(3,6);x=[137 134 410 411 439 455]; for r=1:size(A,1) for c=1...

8 years ago | 0

| accepted

Answered
Can I buy Antenna toolbox for Matlab Home?
<https://www.mathworks.com/store/link/products/home/ML Yes.>

8 years ago | 0

Answered
Code execution in GUI
What you could do is something like the following: f=figure(1);clf(1) handles=struct('f',f,'interuptor',true,'counter',0...

8 years ago | 1

Answered
Plot Legend Not Correct
You can use the output of the plot function to get the handles to the objects. Then you can use the list as an input to |legend|...

8 years ago | 1

Answered
How do i calculate FWHM from Gaussian fitted curve??
More generally, the FWHM is the x-distance that describe the width of your curve halfway from the maximum to the baseline. Your ...

8 years ago | 3

Answered
Apply an array to an equations variable?
Make sure your multiplications are element-wise (and your divisions) by including the dot before your product sign and your divi...

8 years ago | 0

Answered
How can i use the GUIDE to create an interface to an existing program?
I would suggest you don't use GUIDE, but instead write the creating code yourself. My small guide to avoid GUIDE: * Make a fi...

8 years ago | 2

Answered
error. unable to understand error. can you please look at it?
The problem is in the |e(j) = r'*(A);| line. You can double-check the involved values by using the debugger with the breakpoints...

8 years ago | 0

Answered
Find i,j of non-sorted points
There are probably faster/better ways, but this code should do. I commented out two figures that are worthwhile at the explorato...

8 years ago | 0

| accepted

Load more