Johan
Followers: 0 Following: 0
Statistica
RANK
1.179
of 295.527
REPUTAZIONE
60
CONTRIBUTI
1 Domanda
22 Risposte
ACCETTAZIONE DELLE RISPOSTE
100.0%
VOTI RICEVUTI
4
CONTRIBUTI
0 Post
CONTRIBUTI
0 Pubblico Canali
VALUTAZIONE MEDIA
CONTRIBUTI
0 Punti principali
NUMERO MEDIO DI LIKE
Feeds
Risolto
Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...
circa 2 anni fa
How to reduce the computation time of for loop?
You can likely vectorize your code: i_loop = 3264:64:86610 ; M = size(i_loop,1); N = 25; Freq_vec = rand(N,1); Turntable_an...
oltre 2 anni fa | 0
| accettato
Deleting rows of a matrix based on values from another matrix
You can use ismember() to do that: A = randi(5,5,3) B = randi(5,2,1) % Find all the row where col 1 to 2 of A have a value in...
oltre 2 anni fa | 0
| accettato
while solving a couple ordinary differential equation, I'm getting an error of Unable to perform assignment because the left and right sides have a different number of element
func2 and func4 uses A1 and A2 respectively which means they are using the whole arrays, either call A1 and A2 in the func defin...
oltre 2 anni fa | 0
| accettato
Is it possible to explode/expand a map? i.e. separate the countries by a given distance (such as exploding a pie chart)
You could scale the regions around there geometric centers. There are builtin matlab tool using the polyshape structure that can...
oltre 2 anni fa | 0
Data splitting and saving to different variables
You can use structure to do that, you can read more about it in the matlab help https://fr.mathworks.com/help/matlab/ref/struct....
oltre 2 anni fa | 1
finding a specific element based on conditions
1) Your data are row vectors and not column vectors which is why your table statement does not lead to what you expect. Tran...
oltre 2 anni fa | 0
| accettato
How to repeat value in Cell using MATLAB
Hello, I don't know if there is a builtin matlab function to do what you want, this should work: Value = {1,2,3} Count = {2,1,...
oltre 2 anni fa | 0
Risolto
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...
oltre 2 anni fa
how to fill a new vector after a if condition?
I would convert your segment coordinates to points, this way points that are not unique would show that the segment is not an en...
oltre 2 anni fa | 0
| accettato
Speeding up integration within nested for loops
One trick I know to increase speed of calculation is to vectorize your code. I'm not sure that would work for you but you could ...
oltre 2 anni fa | 0
| accettato
Merging Cell Array Elements in One Element
test= [{'1A'} {'2B'} {'3C'} {'4D'}] {cell2mat(test')}
oltre 2 anni fa | 0
Storing elements of product in a row matrix and extracting the nonzero elements
The problem of your code is that you assign the results of your multiplaction to n, which mean that you will only store the last...
oltre 2 anni fa | 0
Risolto
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...
oltre 2 anni fa
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 = ...
oltre 2 anni fa | 1
| accettato
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...
oltre 2 anni fa | 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...
oltre 2 anni fa | 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...
oltre 2 anni fa | 0
Risolto
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...
oltre 2 anni fa
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...
oltre 2 anni fa | 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...
oltre 2 anni fa | 0
| accettato
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...
oltre 2 anni fa | 1
| accettato
Risolto
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...
oltre 2 anni fa
Risolto
Determine if input is odd
Given the input n, return true if n is odd or false if n is even.
oltre 2 anni fa
Risolto
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 ...
quasi 3 anni fa
Risolto
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)* ...
quasi 3 anni fa
Risolto
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...
quasi 3 anni fa
Risolto
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...
quasi 3 anni fa
Risolto
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...
quasi 3 anni fa
Risolto
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...
quasi 3 anni fa