Gelöst


Wind Chill Computation
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...

mehr als 11 Jahre vor

Gelöst


Multiply Column
Given two input, one matrix and one scalar number For example A is a matrix given A = [ 1 2 2 5 2 5 2 3 4 6...

mehr als 11 Jahre vor

Gelöst


Count number of words in string
Count number of words in string E.g. 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3

mehr als 11 Jahre vor

Gelöst


Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

mehr als 11 Jahre vor

Gelöst


Scoring for oriented dominoes
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

mehr als 11 Jahre vor

Gelöst


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

mehr als 11 Jahre vor

Gelöst


Max of a Vector
Write a function to return the max of a vector

mehr als 11 Jahre vor

Beantwortet
how to arrange multiple xlsx files in year to seasonal
[n,tt] = xlsread('input.xlsx'); m = size(n,1); [ii,~] = ndgrid(1:12,zeros(m,1)); j1 = find(ii == 11,1,'first'); ...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
How to do it more efficiently?
[l0,ii] = ismember(time_synced,cCells(:,1)); out = nan(numel(time_synced),size(cCells,2)); out(l0,:) = cCells(ii(l0)...

mehr als 11 Jahre vor | 0

Beantwortet
change size of matrix without changing number of row and column
B = [0 6 7;6 1 0;7 0 1]; C = [0 1 3 5:7;2 0 0 1 0 0; 3 1 0 0 1 0; 8 0 1 0 0 1; 9 0 0 0 0 1]; E = [0 3:7; 8 0 0 1 0 0;9 1...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Unequal partitioning a vector
out = mat2cell(x,1,[3 4 5])

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
integrate 3 matrix into one matrix
A = [e,[q(2:end);w]]; OR A = hankel(q); A(2:end,2:end) = 0;

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to convert string to matrix
A='55 3@ 4 5@ 47 89@ 33 12@' out = reshape(str2double(regexp(A,'\d*','match')),2,[])'

mehr als 11 Jahre vor | 3

Beantwortet
Change string of text into multiple lines
s = ',1,1880802442166,1,751702411341,1,751702411358,1,751702411365,1,751702411372,1,751702411389,1,751702459060,1,751702459077...

mehr als 11 Jahre vor | 1

Beantwortet
Fastest & most effective way to create this matrix:
one way a =[1 2 3 4 5 6 7 8 9]; out = kron([0 0 ; 0 1],a);

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Counting the number of elements that match between a vector and a matrix
nnz(ismember(K,vec))

mehr als 11 Jahre vor | 1

| akzeptiert

Gelöst


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

mehr als 11 Jahre vor

Gelöst


Concatenate two strings
Its very easy. Just concatenate two strings.

mehr als 11 Jahre vor

Gelöst


Palindrome Check
Check whether the entire matrix is palindrome or not. Example matrix = [7 8 7] matrix_reverse = [7 8 7] So the mat...

mehr als 11 Jahre vor

Gelöst


Reverse a matrix
Its simple. You have to reverse a given matrix.

mehr als 11 Jahre vor

Gelöst


Find the area of the four walls
If length, breadth and height of the walls are given, find the area of the four walls.

mehr als 11 Jahre vor

Gelöst


チェッカーボードを作ろう
整数 n が与えられた時、以下の様な1と0を含むn×nの行列を作成しましょう。a(1,1) は1にする必要があります。 例: 入力 n = 5 出力 a が [1 0 1 0 1 0 1 0 1 0 ...

mehr als 11 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 11 Jahre vor

Gelöst


Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

mehr als 11 Jahre vor

Gelöst


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

mehr als 11 Jahre vor

Gelöst


Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

mehr als 11 Jahre vor

Gelöst


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

mehr als 11 Jahre vor

Beantwortet
How to sort file when reading them with dir ?
n = dir('doc_*.txt'); n1 = {n.name}; z = regexp(n1,'(?<=doc_)\d*(?=\.txt)','match'); z1 = str2double(cat(1,z{:})); ...

mehr als 11 Jahre vor | 1

Beantwortet
How to index a sorted array with the actual array?
a = rand(20,1); [new,idx] = sort(a);

mehr als 11 Jahre vor | 0

| akzeptiert

Mehr laden