Solved


Project Euler: Problem 14, Longest Collatz sequence
The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) U...

4 years ago

Solved


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

4 years ago

Solved


Create a secure password
You are joining the MATLAB Central platform to solve a question on Cody. The signup page requires you to input an id and a passw...

4 years ago

Solved


Determine whether a player solved a Cody problem
Write a function to determine whether a player has solved the specified Cody problems. The problem numbers are specified as a ve...

4 years ago

Answered
How to make a loop with 3 variables and to export files
[x,y,z]=meshgrid(0:.1:1); idx=(x+y+z)==1; x=x(idx); y=y(idx); z=z(idx);

4 years ago | 0

Answered
How read the exact number of decimal digits with readtable from a .csv file?
The digits should still be there (just not displayed) as long as they do not exceed floating point accurracy. Look at this: fil...

4 years ago | 4

Answered
how can I write my function in terms of code using Finite difference method (FDM) to obtain these curves at time, t=0 and time, t=2?
x=0:.001:3; u=@(t)exp(-16*(x-(.75*t+.5)).^2).*sin(125.7*x); plot(x,u(0)) figure plot(x,u(2))

4 years ago | 1

| accepted

Solved


Easy Sequences 64: Base-14 Arithmetic Function
For an integer , the base-14 arithmetic function, , is defined as follows: Convert to base-14, using the letters '' for digits...

4 years ago

Answered
How to iteratively increase the number of power operations
n=10;%how many do you want x=2.^((.5).^(1:n))

4 years ago | 0

| accepted

Solved


Easy Sequences 67: Project Euler Problem 1 - Not Again!!!
You know the drill... Given two integers and , with , find the sum of all positive integers below , that are multiples of any ...

4 years ago

Answered
Area in a function
x=-1:.001:1; f=1-x.^4; g=zeros(size(x)); plot(x,g,x,f); x2 = [x, fliplr(x)]; inBetween = [g, fliplr(f)]; fill(x2, inBetwee...

4 years ago | 0

Answered
Distance between two set of points in space
Why no loop? Below is oneliner but has an internal loop. C=arrayfun(@(x)vecnorm((A(x,:)-B)'),1:size(A,1),'UniformOutput',false)...

4 years ago | 0

Answered
How can I equalize my vector length?
PC=250; FFB=PC; yph=0.1:.01:1.08; FG=3*PC*(1-yph)./(0.98-yph); FE=(1./yph - 1).*(0.02*FG); PG=FE+0.02*FG; EP2=PC*8150*12.0...

4 years ago | 0

Answered
How can I change input of function from file to cell array?
Either delete or comment out lines below and change input to data. Verify cell2mat(of your cell array) gives what is expected. O...

4 years ago | 0

| accepted

Answered
Iterative insertion of random numbers in matrix
r1=(5*rand(size(X1))-2.5)*1e-9; r2=(5*rand(size(X1))-2.5)*1e-9; Xnew=X1+r1+r2;

4 years ago | 1

| accepted

Answered
How to get two arrays from .txt file?
Why not just copy and paste? dL1=[0 0.000424 0.000847 0.001271 0.001694... 0.002118 0.002541 0.002965 0.003812... 0.004659 ...

4 years ago | 1

Answered
where is the mistake?
Why not just: w='abcderfrgrhhr'; l=w=='r' l = 1×13 logical array 0 0 0 0 0 1 0 1 0 1 0 0 1...

4 years ago | 0

Solved


determine the sum of decimal part for given matrix
determine the sum of fraction part for the given matrix

4 years ago

Answered
For Loop Help with Output
No for-loop needed. h=.1; y=1; x=0:h:10; Y=y+h*x;

4 years ago | 0

Answered
For Loop to read rows on a cell array
Not sure if this the correct guess. y=sum(strcmp(yourCell,'BB'),2)/size(yourCell,2);

4 years ago | 0

| accepted

Answered
Searching word list for key letters
wordList = {'apples','orange','banana','show','unit'}; ContainList = 'shu'; NotContainList = 'br'; r=wordList(contains(wordLi...

4 years ago | 0

Answered
Plotting values from a double array based on information from a cell array
idx=strcmp(yourCell(:,2),'hold')|strcmp(yourCell(:,2),'hold-end'); plot(yourMatrix(idx,1),yourMatrix(idx,3));

4 years ago | 0

Answered
how to write delta function
Or use dirac() built-in function function x=delta(x) if x==0 x=inf; else x=0; end

4 years ago | 0

| accepted

Answered
Research of an element in an array
This should work for you as long as there is only going to be a single match or no match K=find(S==X,1); if ~isempty(K) d...

4 years ago | 0

Answered
Plotting values from a double array based on information from a cell array
a=strcmp(yourCell(:,2),'max-pressure-evac 60.0'); f=find(a)'; f=f+(0:numel(f)-1); for k=f yourCell(k+1:end+1,:)=yourCell(k...

4 years ago | 0

| accepted

Solved


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

4 years ago

Solved


Wordle
Wordle is an english game where you need to guess a 5 letter word. For each guess you'll receive a feedback for the placement of...

4 years ago

Solved


Determine Fundamental Solution of Pell Equation
Given, a positive value (d), determine the fundamental solution [x, y] of the Pell equation: x^2 - d*y^2 = 1. Provide character...

4 years ago

Load more