답변 있음
Linear fit between two sets of independent variables
If your model if y = x; Then, m = mean(y); J = sum((x-y).^2); S = sum((y-m).^2); r2 = 1 - (J/S); % R^2 value or c...

거의 13년 전 | 0

답변 있음
Run a loop through multiple matrices
Something like this: for i = 1:5 eval(['A' num2str(i) '(' 'A' num2str(i) '<0.1 | A' num2str(i) '>0.3)' '=' 'NaN']) ...

거의 13년 전 | 0

답변 있음
Setting the amount of data points before plotting
How about function hydrogenusage P = 0:1:4000; Q= (120*P)-(P.^2); plot(P,Q) xlabel('Power') ylabel('Usage') ...

거의 13년 전 | 0

| 수락됨

답변 있음
error: In an assignment A(I) = B, the number of elements in B and I must be the same.
The problem is in re(i)=re(i)+N(i)*b*(L/2)*alpha(g); b is (n*1) matrix and L is a (1,n) matrix. If you are doing, what I...

거의 13년 전 | 0

답변 있음
Delete rows of a matrix
Lets say you matrix is something named A. Tol = 1e-6; count = 1; flag = 1; while (flag == 1) temp1 = A(count+1:...

거의 13년 전 | 0

질문


Small Probabilities appearing less frequent using rand
I am trying to do some Monte Carlo Type simulations. In this, I have few choices which needs to be selected using weighted proba...

거의 13년 전 | 답변 수: 2 | 0

2

답변

답변 있음
Problem with if function and decimal numers
The issue is very small difference in floating point numbers, like 1.00000 and 1.0000000001. There is negligible difference howe...

거의 13년 전 | 0

답변 있음
create periodic tasks set
Lets say you have execution time and period in vector A and B, respectively. Then you might do something like this: for i =...

거의 13년 전 | 0

답변 있음
Working with Dates,Problem with syntax
Following your code trend: strfind might not work in this case as for example if you are looking for January (01) in a date stri...

거의 13년 전 | 0

| 수락됨

답변 있음
Confuse with function handles, matrix and single point
In defining f, you didn't do the function right. To take a value of x as a vector, you need to use *./* instead of just */* . I...

거의 13년 전 | 0

| 수락됨

답변 있음
"Not enough input arguments" plotting a function
First define r like r = 1:10; Then do the plotting using, plot(r,sFn(r))

거의 13년 전 | 0

| 수락됨

답변 있음
How do i obtain a matrix from a gui table to multiply it to another matrix?
that's because tableData is undefined in pushbutton2_callback. add global tableData; before a = str2num(tableData). this will...

거의 13년 전 | 0

| 수락됨

답변 있음
"Too many input arguments" error on function within GUI code
Try rhImport(hObject,eventdata) instead of just rhImport.

거의 13년 전 | 0

| 수락됨

질문


Matlab 2013a versus 2012b (Speed Issue)
I have a long simulation which I wrote while using Matlab 2012b. I run it on a more powerful linux system which has 2013a versio...

거의 13년 전 | 답변 수: 0 | 0

0

답변

답변 있음
Generating a random binary matrix
A = randi([0 1], n,m)

거의 13년 전 | 13

| 수락됨

답변 있음
How do I create such matrix ? (please look at the thread for further details)
How about C = A; C(:,2:end) = A(:,2:end)-B(:,1:end-1); This solution is for generalized (n*m) system.

거의 13년 전 | 0

답변 있음
How to find the global mean(average)of the entire scene of a hyperion hyperspectral data.
If by global mean, you mean the mean value of the reflectance values throughout the whole bands, then you can do something like ...

거의 13년 전 | 0

답변 있음
sphere made of 2d circles in 3d plot
You can use sphere function to create a sphere. Do you specifically need sphere from circles?

거의 13년 전 | 0

답변 있음
How to scale the axis while ploting some function which changes its size on every iteration?
Use ylim([min max]) right after plot(x,y). I think you might have put ylim after drawnow, this adjust the y-axis but after plott...

거의 13년 전 | 0

| 수락됨

답변 있음
How to get a 10 day avergaed data set from a daily data set
Lets say, your dataset is called A. [m,~] = size(A); tmp1 = cumsum(A(:,2:3)); tendayAvg = zeros(m-9,2); tendayAvg(...

거의 13년 전 | 0

문제를 풀었습니다


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

거의 13년 전

문제를 풀었습니다


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

거의 13년 전

문제를 풀었습니다


Is my wife right?
Regardless of input, output the string 'yes'.

거의 13년 전

문제를 풀었습니다


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

거의 13년 전

문제를 풀었습니다


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

거의 13년 전

문제를 풀었습니다


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

거의 13년 전

문제를 풀었습니다


Add two numbers
Given a and b, return the sum a+b in c.

거의 13년 전

문제를 풀었습니다


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

거의 13년 전

문제를 풀었습니다


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

거의 13년 전

문제를 풀었습니다


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

거의 13년 전

더 보기