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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 3

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 1

| aceptada

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

alrededor de 8 años hace | 1

| aceptada

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 3

| aceptada

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 5

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

alrededor de 8 años hace | 1

| aceptada

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 1

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

alrededor de 8 años hace | 1

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

alrededor de 8 años hace | 3

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 2

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

alrededor de 8 años hace | 0

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

alrededor de 8 años hace | 0

| aceptada

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

alrededor de 8 años hace | 1

Cargar más