Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

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

mehr als 10 Jahre vor | 1

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

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 0

Beantwortet
delete element from vector
% Use logical indexing a = a(a~=3)

fast 11 Jahre vor | 1

Gelöst


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

fast 11 Jahre vor

Gelöst


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

fast 11 Jahre vor

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 1

Beantwortet
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,'...

mehr als 11 Jahre vor | 0

| akzeptiert

Gelöst


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

mehr als 11 Jahre vor

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

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
selecting file from a database (.txt files) ?
Please see attached file.

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

Gelöst


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

fast 12 Jahre vor

Mehr laden