문제를 풀었습니다


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

대략 8년 전

문제를 풀었습니다


Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

대략 8년 전

문제를 풀었습니다


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

대략 8년 전

문제를 풀었습니다


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

대략 8년 전

문제를 풀었습니다


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

대략 8년 전

문제를 풀었습니다


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

대략 8년 전

문제를 풀었습니다


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

대략 8년 전

문제를 풀었습니다


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

대략 8년 전

문제를 풀었습니다


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

대략 8년 전

문제를 풀었습니다


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

대략 8년 전

문제를 풀었습니다


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

대략 8년 전

답변 있음
How to get two adjacent columns in loop
You need not use a for loop for this. rData = DATA(:,2:2:end-1) % Get all the real data col 2,4,6...1022 iData = DATA(:,3:...

대략 8년 전 | 1

답변 있음
How to save certain values in a FOR loop
just before the start of the first for loop, define an empty matrix, this will be the storage for all the valid step-values. Rep...

대략 8년 전 | 0

| 수락됨

답변 있음
How to display continuous changing values in static text of GUI
I think your code is working fine. Try putting a little time delay before setting the string of handles.text1. Something like, ...

대략 8년 전 | 0

답변 있음
delete element from vector
% Use logical indexing a = a(a~=3)

8년 초과 전 | 0

문제를 풀었습니다


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

8년 초과 전

문제를 풀었습니다


Fahrenheit to Celsius using multiple statements
Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

8년 초과 전

답변 있음
Where can I insert my Operation and How to display the result in Static Text?
Please see the attached files.

대략 9년 전 | 0

| 수락됨

답변 있음
Can I run a "clear java" command but still keep a variable in the workspace?
I guess you can store those java variables in a structure and run "clear java"; the variables should still be available in the s...

대략 9년 전 | 0

답변 있음
separating x and y from an equation
%% USE regexp to split the string % str = regexprep('2x-3y^2','(\d+)(\w+)','$1*$2'); str = regexprep(str,'(\w+...

대략 9년 전 | 0

답변 있음
How to remove the tic labels but not the marks?
%% To remove tick marks on the y-axis tickMarks = {'YTick',[]}; set(gca,tickMarks{:});

대략 9년 전 | 1

답변 있음
How to remove the tic labels but not the marks?
%% Remove tick labels for the X and Y axes tickCell = {'XTickLabel',{},'YTickLabel',{}}; set(gca,tickCell{...

대략 9년 전 | 1

답변 있음
How do I ignoring '\n' at the end of the text file that was created?
You are appending that extra line. What you can do is change: fprintf(output,'%s\n',line) to fprintf(output,'...

대략 9년 전 | 0

| 수락됨

문제를 풀었습니다


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

대략 9년 전

답변 있음
selecting file from a database (.txt files) ?
function files = listFiles(key,directory,ext) %% LIST FILES % key : the machine name or day % : if search...

대략 9년 전 | 0

| 수락됨

답변 있음
selecting file from a database (.txt files) ?
Please see attached file.

대략 9년 전 | 0

답변 있음
How to optimize this code?Please help me and guide me in this direction.
To store matrices in a matrix you need to use a cell array. A cell array is capable of storing any data type. Hence we are first...

대략 9년 전 | 0

답변 있음
Select every Nth row from number groups
a = [1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1]; isTake = false; newMatrix = nan*ones(size(a)); count = 0; for...

대략 9년 전 | 0

답변 있음
How can I create a matrix out of a matrix?
indices = find(any(A,2)); B = [indices A(indices,:)];

대략 9년 전 | 1

문제를 풀었습니다


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

9년 초과 전

더 보기