Risposto
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...

circa 8 anni fa | 0

| accettato

Risposto
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 ...

circa 8 anni fa | 0

Risposto
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'},{'!','%'}); ...

circa 8 anni fa | 3

Risposto
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...

circa 8 anni fa | 0

Risposto
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.

circa 8 anni fa | 0

| accettato

Risposto
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,...

circa 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 0

| accettato

Risposto
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 |...

circa 8 anni fa | 0

| accettato

Risposto
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...

circa 8 anni fa | 1

| accettato

Risposto
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...

circa 8 anni fa | 1

| accettato

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

circa 8 anni fa | 0

| accettato

Risposto
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) ...

circa 8 anni fa | 0

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

circa 8 anni fa | 3

| accettato

Risposto
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...

circa 8 anni fa | 0

| accettato

Risposto
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...

circa 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 0

Risposto
[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...

circa 8 anni fa | 5

Risposto
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...

circa 8 anni fa | 1

| accettato

Risposto
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....

circa 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 0

| accettato

Risposto
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...

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 1

Risposto
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|...

circa 8 anni fa | 1

Risposto
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 ...

circa 8 anni fa | 3

Risposto
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...

circa 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 2

Risposto
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...

circa 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 0

| accettato

Risposto
[DISCONTINUED] MATLAB Answers Wish-list #4 (and bug reports)
Not really MATLAB Answers wish, but because the FEX is often mentioned/linked here: Some notification if an entry uses functi...

circa 8 anni fa | 1

Carica altro