답변 있음
Saving values in a vector inside a loop, and finding the specific loop at which a certain element is saved
A few thoughts: * There is a potential problem in your code as you set the loopcounters s and t to a value within the loop. ...

대략 8년 전 | 1

답변 있음
control for-loop index using a gui slider
My first recommendation would be to use an infinite while loop. Fo starters, in pseudocode: function StartButtonPressed ...

대략 8년 전 | 0

| 수락됨

답변 있음
Why, when I pass a structure S into a function, and assign or update more fields to it, does it remove the fields it had when entering the function?
I suspect you have a _clear all_ statement (or _clear S_) inside your function ...

대략 8년 전 | 0

답변 있음
loop becomes terminated after i=1 it is not continuing
i loops from 1 to nb-1, so ... did you check the value of nb?

대략 8년 전 | 2

| 수락됨

답변 있음
How can I change pixel color of particular X and Y coordinates easily?
Having a lot of variables labeled A1, A2, A3 etc. in your workspace that are related is generally a very bad idea, inducing lots...

대략 8년 전 | 0

| 수락됨

답변 있음
Pause code while importing data
Using an output of uiimport will stall execution of later code. S = uiimport('-file') disp('Import finished.') % an...

대략 8년 전 | 0

답변 있음
Too many plots..too little time!!
why don't you try *histogram* and use the help to improve the plot, add a fit etc. n = 10+5*randn(1,100) ; histogram(n)

대략 8년 전 | 1

답변 있음
Column Indexing and help finishing function
You want to update a single column, but keep the rest! You can do this by indexing on the left hand side of the assignment opera...

대략 8년 전 | 0

답변 있음
Finding Continuous missing values (NaN) from a matrix
I am not sure what you mean by " _count the amount of continuous NaN's_". Do you want know total number of NaN values in X? The ...

대략 8년 전 | 0

답변 있음
Real-Time Eye Tracking ... help!
You could perform some kind of mapping from eye position in the camera to the coordinates on the screen, that is, a calibration....

대략 8년 전 | 0

답변 있음
When I start and end a function. I get the error ('local function has the same name as file'). can anyone help with this. Thank you
_function_ should be the *first word* in the m-file that defines the function! (remove the clc and clear)

대략 8년 전 | 0

| 수락됨

답변 있음
How to count the number of consecutive identical elements (in both the directions) in a binary vector ?
Something like this? X = [0 0 0 0 1 1 1 0 1 1 1 1] % row vector! numX = numel(X) ; Q = find([false diff(X)...

대략 8년 전 | 1

답변 있음
Dividing data set into subsets and plot them on same graph, with individual trend lines
% create artificial data N = 6 ; % number of data sets M = arrayfun(@(k) polyval([randi(10) 2*k], 1:10), 1:N, 'un',0) ;...

대략 8년 전 | 0

답변 있음
how to create this matrix [1 2 3 4 5;2 2 3 4 5;3 3 3 4 5;4 4 4 4 5;5 5 5 5 5]
% data n = 7 % "order" % engine x = repmat(1:n,n,1) x = max(x, x.') _Added after comment:_ for non-square...

대략 8년 전 | 0

| 수락됨

답변 있음
How can i get almost similar row from amatrix
You have to define "similar" more strictly! Here I have take the norm as the similarity measure, but there are other alternative...

대략 8년 전 | 0

답변 있음
Keep the value of randperm after clear all
* learn to use functions rather than scripts, pass the variables needed for the second function as arguments. No need for clear ...

대략 8년 전 | 0

답변 있음
Create multidimensional matrices from two multidimensional cells.
The operator * may not do what you expect. Try this A = [1 2 3] ; B = [4 5 6] ; C = [10 20 30 40 50] % A * B % error ...

대략 8년 전 | 0

답변 있음
How can I change pixel color of particular X and Y coordinates easily?
transform the subindices into linear indices using sub2ind [r,g,b] = deal(0.5 * ones(10)) ; % example image x = [2 4 6 3...

대략 8년 전 | 0

답변 있음
find nonzero minimum element in a matrix
Why not set the values to Inf, rather then zero? Or to Nan and use nanmin instead? To find the overall minimum of a matrix M ...

대략 8년 전 | 0

| 수락됨

답변 있음
How can I replace values in an array with the value in the previous column's value?
Somewhat simpler: n = zeros(1,4) ; % array of specific length while (1) % i...

대략 8년 전 | 1

| 수락됨

답변 있음
Dividing a set of numbers into set of intervals and caculating the mean of each interval and comparing it with the previous one
I understood your question somewhat different: "I have N numbers {x(1) x(2) ... x(N-1) x(N)} and want to split them into several...

대략 8년 전 | 1

답변 있음
Hey guys. Could use some help in obtaining output from the cell array.
Like this? output = {'X123','X456','X789'} MyStringOutput = ['sometext ' sprintf('%s ',output{:}) 'moretext']

대략 8년 전 | 0

| 수락됨

답변 있음
single vs multiple fprintf() efficiency
You can skip the format identifier for string inputs, simply because fprintf uses the format identifier to transform its inputs ...

대략 8년 전 | 0

답변 있음
uncertainty in linear fit
Unfortunately, the first output of the function polyfit, being the coefficients of the fit changes, with the requested number of...

대략 8년 전 | 0

답변 있음
Simple if else function
You should call the function like this [out1, out2] = inertimoment('rektangel', 3, pi) By the way, the else in your cod...

대략 8년 전 | 0

| 수락됨

답변 있음
Creating a matlab shortcut to create a matlab script file with the assignment name and a certain header.
insert this before the first fprintf fid = fopen(s, 'wt') ; if fid == -1 return end and end your script with...

대략 8년 전 | 0

답변 있음
offset matrix multiplication with loop
% test data A = randi(10,3,4) B = cumsum(ones(size(A))) % engine C = A(2:end,:) .* B(1:end-1,:) % C(i,j) = A(i+...

대략 8년 전 | 1

| 수락됨

답변 있음
How to exclude rows on the basis of specific entries?
Here is a flexible example: % data X = [4 4] ; % rows starting with this should be discarded A = [1 4 1 4 ; 4 4 2 2 ;...

대략 8년 전 | 0

제출됨


nchoosecrit(S, FUN)
returns those subsets (= combinations of elements of a set) that fulfill a specific criterion

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

5.0 / 5

답변 있음
How can we Evaluate performance from confusion matrix ..........? using true positive and true negative etc.
The definitions are all over the internet, for instance, here: <http://www.dataschool.io/simple-guide-to-confusion-matrix-ter...

대략 8년 전 | 0

| 수락됨

더 보기