답변 있음
Selecting random x number from "N" input numbers.
You can use randperm (remember to round the percentage to an integer number of positions): percentage = 30; total = 10; out...

대략 3년 전 | 0

답변 있음
How to save a visualized image and the ROI ?
If you want to save what you see in a figure, you should first capture the contents with getframe. If you want to change the ...

대략 3년 전 | 0

| 수락됨

답변 있음
How to return a structure as a function output?
If you want the entire struct as the output, then you should make the struct the output: function S = ComputeR(frame);

대략 3년 전 | 0

| 수락됨

답변 있음
how to calculate the derivative of a matrix
Jan has all but given you the function you should be using: the max function. S=load(websave('data.mat','https://www.mathworks....

대략 3년 전 | 0

답변 있음
Largest lindexing supported by MATLAB?
For a double, you can just look at the error message: try A=[]; A(flintmax)=1; catch ME,disp(ME.message),end And if...

대략 3년 전 | 2

| 수락됨

답변 있음
Open .fig files for editing without having MatLab
You could try using GNU Octave to modify the fig file. There are many downsides to using Octave instead of Matlab (I'm still pl...

대략 3년 전 | 0

답변 있음
Picking random values from an array.
k=round(numel(Data)/100); Data(sort(randperm(end,k)) This will give you a random sample of your vector.

대략 3년 전 | 0

답변 있음
How to fix a callback for a checkbox
Perhaps you should have a read <https://www.mathworks.com/matlabcentral/answers/483657-how-to-create-a-gui here>. You probabl...

대략 3년 전 | 0

답변 있음
Error: Too many functions when plotting series
I suspect this will do what you want: fplot(x,S1); hold on fplot(x,S2) hold off

대략 3년 전 | 1

답변 있음
how can i use table after a function?
You can make P a second output of your function. That way you can call it with the final value of L and extract what you want. ...

대략 3년 전 | 0

| 수락됨

답변 있음
Have time object start and stop at a specific time
You need to set the delay depending on the time that the timer object is created. The number of calls can be either calculated o...

대략 3년 전 | 0

| 수락됨

답변 있음
I want help solving differential equations
Exp is a function, not a number. There is also no implicit multiplication. My (untested) suggestion would be this: syms ...

대략 3년 전 | 0

| 수락됨

제출됨


findND
find for 3D or ND

대략 3년 전 | 다운로드 수: 1 |

5.0 / 5

답변 있음
how to rename multiple file with sequent custom number?
You may want to consider using movefile instead. That will make this code rely only on Matlab tools, instead of being OS-specifi...

대략 3년 전 | 0

| 수락됨

답변 있음
change an image from rectangular to square by adding white area
The documentation for padarray states it will pad with 0. If you don't want that, you will have to provide the value as the thir...

3년 초과 전 | 1

답변 있음
Index in position 2 exceeds array bounds. Index must not exceed 7?
Since i and j both range from 1 to the number of rows in f, there is no reason i+j will be less than the number of columns in f....

3년 초과 전 | 0

| 수락됨

답변 있음
Swap k elements in an n x1 vector
Create a logical vector with at most c true elements. Then permute the values at those positions and use logical indexing to sto...

3년 초과 전 | 0

답변 있음
Each time you run the program, a new.msh file is generated
You can use the tempname function to generate a random file name. You can also use sprintf to compose a file name that includ...

3년 초과 전 | 0

| 수락됨

답변 있음
Incorrect Inputformat for datetime function
If you remove the quotes in your input format it should work. Since there are no quotes in your input text, you don't need them....

3년 초과 전 | 0

답변 있음
How do I using logical values to write 'NAN' to non-existing data?
You can use ismember: A=[ones(5,2).*[0 2] (-90:-86).']; B=[ones(4,2).*[0 2] [-90;-89;-87;-86]]; new_B=nan(size(A)); [~,row...

3년 초과 전 | 0

| 수락됨

답변 있음
Multiplying individual columns of a matrix
You need to index ytrain the other way around, not ytrain(:,n), but ytrain(n,:).

3년 초과 전 | 1

답변 있음
When loading .csv it separate the column on " " and not ",". How to fix this?
You should really read the documentation, which will show you how to use the 'Delimiter' option (and the NumHeaderLines option)....

3년 초과 전 | 0

| 수락됨

답변 있음
How permutate 2-by-2 matrices in a single matrix
You're close. You just need to store a, b, and c in a cell array and use perms to create indices. The benefit of this approach ...

3년 초과 전 | 0

답변 있음
Subtracting values form rows with same variable
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). It...

3년 초과 전 | 0

| 수락됨

답변 있음
How do I perform a formatted read on exponential data?
Edit at the top: You can get the data in this format with my readfile function, or with data=cellstr(readlines(filename));. T...

3년 초과 전 | 0

답변 있음
Acess all last array elements withtin cells
Loops are faster than cellfun (excluding the legacy syntax). The reason is that cellfun will hide the loop internally and you ha...

3년 초과 전 | 0

답변 있음
Find the desired row in the matrix
Inspired by the answer and comment by Jan, I gave it a try as well. However, at least for this size, the answers from Jan are fa...

3년 초과 전 | 1

답변 있음
How to plot x = 1 without any y variable
doc xline

3년 초과 전 | 0

답변 있음
fprintf modifying txt file in the wrong way
If it's a sufficiently old program, it might expect a carriage return along with a line end. I would suggest reading the file...

3년 초과 전 | 0

답변 있음
Error in using an element in a matrix as function input
You need to pass the entire array, or treat each element as a separate variable. You can of course create the c array inside you...

3년 초과 전 | 1

| 수락됨

더 보기