Community Profile # Johan Pelloux-Prayer

Last seen: 2日 前 2021 以来アクティブ

#### Statistics

All
• • • • • • • バッジを表示

#### Content Feed

Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

2ヶ月 前

Combining two vectors into a new one
I don't know if there is a builtin function to do that but you can achieve using translation, logical condition and find: A = ...

3ヶ月 前 | 1

| 採用済み

How to write an 'if' script that changes a function depending on x?
you need to use elseif for secondary condition in your if statement: function y=funk(x) if x <= 3; y=sin...

3ヶ月 前 | 0

How do I calculate the moment of force due to a load distribution or at least get a point of application?
Assuming you have an XY array of data, dividing it in two part can be done by filtering the data against a chosen criteria: XYd...

3ヶ月 前 | 0

what is the efficient way to search for value in a large struct
I'm not sure that fits what you want but you could try making large arrays in a small structure instead of the opposite: tree(1...

3ヶ月 前 | 0

Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

3ヶ月 前

Making a Surface plot transparent
I think FaceAlpha does work but your mesh size is so small that you only see the edges plotted which are not transparent in your...

3ヶ月 前 | 0

How to improve my inefficient code?
(modified from comment to get rid of empty rows) Maybe this would work for you ? %transform your table in an array workdat...

3ヶ月 前 | 0

| 採用済み

How to reduce code lines for data post-processing by using for-loops?
You can use structure to organize your data and simplify your analysis. For example you can define the path of the file you want...

3ヶ月 前 | 1

| 採用済み

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

3ヶ月 前

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

3ヶ月 前

Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

3ヶ月 前

Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

3ヶ月 前

Check whether a Wordle guess is consistent with previous feedback
The game Wordle resembles the classic game Mastermind. Players try to guess a five-letter word, and after each guess they are to...

3ヶ月 前

Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

3ヶ月 前

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

3ヶ月 前

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

3ヶ月 前

Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<https://i.imgur.com/jlZDHhq.png>> Image courtesy of <http://up...

3ヶ月 前

Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<https://i.imgur.com/jlZDHhq.png>> ...

3ヶ月 前

Time reverse indices
Time reverse the index values as follows IndexIn = [7 1 0] IndexOut = [7 6 0] Note that the indices are zero based and so...

3ヶ月 前

I need help in the code. what am I doing wrong?
Hi, I think you can just add a check for a ':' character in your code. Alternatively you can also use regular expression to do ...

6ヶ月 前 | 0

| 採用済み

Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<https://imgur.com/x6hT6mm.png>> ...

7ヶ月 前

Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

7ヶ月 前

How can I plot (scatter diagram) three data series at the same time?
Hello Robert, You can use conditional statement inside an array call to filter it with your wanted data: myarray = [500,1,2;50...

7ヶ月 前 | 0

| 採用済み

finding equal (lon,lat) in another matrix of different size
I'm not sure exactly what you mean by A is bigger than B, if you can give a simple example of A and B it would help in helping y...

7ヶ月 前 | 1

| 採用済み

Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

8ヶ月 前

Sums of cubes and squares of sums
Given the positive integers 1:n, can you: 1. Compute twice the sum of the cubes of those numbers. 2. Subtract the square...

8ヶ月 前

Relative ratio of "1" in binary number
Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

8ヶ月 前

Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

8ヶ月 前

Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

8ヶ月 前