Risposto
Could anyone tell what is the difference between ind and idx.
As <https://www.mathworks.com/matlabcentral/profile/authors/12023730 Dennis> mentioned, they are both abbreviations for index. ...

quasi 8 anni fa | 0

| accettato

Risposto
finding interception of 3 spheres to calculate the coordinates of the 2 points
I don't have the symbolic toolbox, so I can't test any of this, but it should at least give you an idea of how to start. xy...

quasi 8 anni fa | 0

Risposto
Counting a pattern frequency in a column
The code below will count the number of times that the pattern you describe is found in the third row of the Excel file. My...

quasi 8 anni fa | 1

| accettato

Risposto
How can I multiply a (13*1) vector by a (13*13*1269) matrix?
3D multiplications are not defined in Matlab, so I'm going to assume your intended output is something like this: %initiali...

quasi 8 anni fa | 0

| accettato

Risposto
Can I replace NA values with NaN values in an array?
The code below will look for any cells that are equal to |'NA'| and replace them with |NaN|. data=importdata('SCG_2001.csv'...

quasi 8 anni fa | 0

| accettato

Risposto
How to group elements of matrix?
The |reshape| function is especially useful, since you don't have to determine the size of the other dimension yourself: A=...

quasi 8 anni fa | 0

| accettato

Risposto
Could anyone help me to solve the issue for the following code
I think I understand what you mean. If I do, then the code below should work for you. A=1:12; B=0; while ~isempty(A) ...

quasi 8 anni fa | 0

| accettato

Risposto
How can I remove the warning: " the value assigned to 'varbaile_name' might be unused"
You are overwriting the variable, so that's why you get this warning. If you would be using the variable, but in a way that code...

quasi 8 anni fa | 1

Domanda


R2018a functionSignatures.json (user function tab complete) not working as documented outside of live-script
In a recent thread, I came across a mention of a new feature in R2018a: tab completion suggestions for user-defined functions. <...

quasi 8 anni fa | 1 risposta | 2

1

risposta

Risposto
download matlab compiler for R2017b
You can get the <https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c-compiler MinGW-w64 ...

quasi 8 anni fa | 0

Risposto
How can I convert a matrix to all numeric values which contains numeric and characters both?
If you want to replace the NaNs by 0, you can simply use this: data(isnan(data))=0;

quasi 8 anni fa | 0

Risposto
How to make GUI window repeat a block of code until closed without blocking other operation
Yes, you can use e.g. a |togglebutton|. Use a |drawnow| somewhere in your loop (or a small |pause|) so its callback gets execute...

quasi 8 anni fa | 1

| accettato

Risposto
Find minimum in one variable only
You can use a trick to make it a single input function: use a vector. f = @(x,t)cos(x)*exp(t^2); B=fminbnd(@(b)f(b(1),b...

quasi 8 anni fa | 0

Risposto
How to search a string number in a cell
Not very pretty code, but it does return 3. req='27' tt1 = {'22' '25' '56'}; tt2 = {'2' '45' '89' '67' '10' '1'}; ...

quasi 8 anni fa | 0

Risposto
Can I save my figure somewhere else on my computer besides the MATLAB folder? (Using Saveas)
You are right that the <https://www.mathworks.com/help/releases/R2018a/matlab/ref/saveas.html documentation for |saveas|> doesn'...

quasi 8 anni fa | 1

| accettato

Risposto
reshape matrix without loop
I now wrote it with |accumarray|, without needing the call to |unique|. I also added a part that handles any empty positions (I ...

quasi 8 anni fa | 1

Risposto
Whike loop does not work and there is not error message
You switched the condition: it is false on the first iteration and true when your loop should exit, which is the reverse from wh...

quasi 8 anni fa | 0

| accettato

Risposto
What does this error mean in the command window: "Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit" ?
You actually blotted out the most import part of your code, as the rest is never reached. You run a function that calls itself. ...

quasi 8 anni fa | 0

Risposto
How to randomly generate a row with restrictions?
The code below uses a random process to fill the vector. If it fails, it will restart. The distribution of needed tries a nice e...

quasi 8 anni fa | 1

Risposto
Plot image in 3D and ignore certain values
If you switch to |double|, you can set the zeros to |NaN|, which will be hidden by surf. You'll then have to adjust the axis lim...

quasi 8 anni fa | 0

| accettato

Risposto
How to produce all possible combination of matrices when deleting vector rows from original matrix?
This should help you along. The construction with the for-loop makes use of the fact that Matlab loops through the second dimens...

quasi 8 anni fa | 0

| accettato

Risposto
Buying matlab license but using only on mobile
First off, I'm not a Mathworks employee, so I can't give you any assurances about the correctness of this information, but this ...

quasi 8 anni fa | 0

Risposto
I have an image which is full black background and the image contain few of white point. How can i draw a straight line that connected most of the white point as shown in figure.
Below you find the code by <https://www.mathworks.com/matlabcentral/profile/authors/5426665-jonas Jonas> that I adapted to use |...

quasi 8 anni fa | 0

Risposto
How do I fill a matrix with values using the tril, diag function without it overwritting the previous command?
You're close, see if the code below works for you. I fixed some typos in the previous code. Now it runs and should give you t...

quasi 8 anni fa | 1

| accettato

Risposto
How to count the number of times a value from a vector exceeded an interval?
The rules you want are a bit unclear, but if I understand them correctly, the code below should do what you want. If not, please...

quasi 8 anni fa | 0

| accettato

Risposto
Finding max value in a matrix, compare it and replace it by the new value
You can simply use a loop and the max function. I doubt the conversion to a cell array and using cellfun is worth it. Another...

quasi 8 anni fa | 1

Risposto
How to multiply a 3x3 kernel to a gray scale image (uint8) ?
You should indeed cast your image to double to avoid underflow and overflow. Another way to do this is to simply use the conv fu...

quasi 8 anni fa | 0

| accettato

Risposto
Printing 2 column vectors of different sizes
This solves it for the general case: Out=zeros(max([numel(xv) numel(xu)]),2); Out(1:numel(xu),1)=xu; Out(1:numel(xv),2...

quasi 8 anni fa | 0

Risposto
Index a matrix to erase or replace with NAN some arrays that meet condition
(untested, may contain typos) ind=A(:,2)>0 & A(:,1)==1; A(ind,:)=NaN;%or =[];

quasi 8 anni fa | 2

| accettato

Risposto
Why do I get Subscript indices must either be real positive integers or logicals using this code? It appears that the error is in the last two lines. How can I solve this?
There are two big problems here: you did not format your code (by selecting your code and clicking the *{}Code* button), so it i...

quasi 8 anni fa | 0

Carica altro