Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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.

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

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

alrededor de 10 años hace | 1

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

alrededor de 10 años hace | 0

| aceptada

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

alrededor de 10 años hace | 0

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

más de 10 años hace | 1

Resuelto


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

más de 10 años hace

Resuelto


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

más de 10 años hace

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 1

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

alrededor de 11 años hace | 1

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

alrededor de 11 años hace | 0

| aceptada

Resuelto


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

alrededor de 11 años hace

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 1

Resuelto


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

más de 11 años hace

Cargar más