已解决


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 years 前

已解决


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 years 前

已解决


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 years 前

已解决


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 years 前

已解决


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

8 years 前

已解决


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

8 years 前

已解决


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 years 前

已解决


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 years 前

已解决


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

8 years 前

已解决


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 years 前

已解决


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

8 years 前

已回答
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 years 前 | 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 years 前 | 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 years 前 | 0

已回答
delete element from vector
% Use logical indexing a = a(a~=3)

9 years 前 | 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...

9 years 前

已解决


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

9 years 前

已回答
Where can I insert my Operation and How to display the result in Static Text?
Please see the attached files.

9 years 前 | 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 years 前 | 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 years 前 | 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 years 前 | 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 years 前 | 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,'...

10 years 前 | 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...

10 years 前

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

10 years 前 | 0

| 已接受

已回答
selecting file from a database (.txt files) ?
Please see attached file.

10 years 前 | 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...

10 years 前 | 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...

10 years 前 | 0

已回答
How can I create a matrix out of a matrix?
indices = find(any(A,2)); B = [indices A(indices,:)];

10 years 前 | 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 ...

10 years 前

加载更多