A résolu


Differential equations I
Given a function handle |f| an initial condition |y0| and a final time |tf|, solve numerically the differential equation dy...

plus de 3 ans il y a

A résolu


Make a Plot with Functions
Make a plot and test

plus de 3 ans il y a

A résolu


Monte-Carlo integration
Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....

plus de 3 ans il y a

A résolu


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

plus de 3 ans il y a

A résolu


Throwing Dice - Will You Be Eaten By The Dragon?
You and a dragon have agreed to let dice rolls determine whether it eats you or not. The dragon will roll a single die, of x ...

plus de 3 ans il y a

A résolu


Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

plus de 3 ans il y a

A résolu


Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...

plus de 3 ans il y a

A résolu


Solve a System of Linear Equations
Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

plus de 3 ans il y a

A résolu


Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

plus de 3 ans il y a

A résolu


Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

plus de 3 ans il y a

A résolu


Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

plus de 3 ans il y a

A résolu


Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

plus de 3 ans il y a

A résolu


Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

plus de 3 ans il y a

A résolu


Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...

plus de 3 ans il y a

A résolu


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

plus de 3 ans il y a

A résolu


MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

plus de 3 ans il y a

A résolu


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

plus de 3 ans il y a

A résolu


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

plus de 3 ans il y a

Réponse apportée
Find the nearest two values in all grid cells to a specified value across a 3D matrix
Why squeeze the indices? Just use them to index (for which you need sub2ind). As for the second closest: the easiest way is to ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Calling the error function does not print the line number in r2022b
I personally use my own customized versions of error and warning. They take an options struct as the first argument to determine...

plus de 3 ans il y a | 2

Réponse apportée
Pseudorandom character matrix generation
If you want a 10x10 char array, you can also use indexing: source = 'bdpq'; Array = source(randi(end,[10 10]))

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
If not with a xlsx file
You should have used isempty in your current code: if ~isempty(app.filename) For the test you now want to do, you should extra...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Saving file causes glitch
As a temporary workaround you can use this: edit my_script.m % should give you a popup asking if you want to create the file O...

plus de 3 ans il y a | 0

Réponse apportée
Fitting data from file
You can specify those parameters, but what is much more effective is providing good initial guesses (and not mixing up x and y):...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
get alpha (color) value of a line
I have no clue why this is hidden, but converting the object to a struct and hunting for a few appropriate candidates I found th...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Appending mixed types to strings seems a bit tricky. Is this the intended behaviour?
It helps to do this step by step, which show that (while unintuitive), this is intended behavior. Matlab evaluates code from le...

plus de 3 ans il y a | 3

| A accepté

Réponse apportée
How to assign matrices to an array in a for loop
You can use a cell array: for i = 1:5 matrices{i} = [i*1 i*2 i*3; i*4 i*5 i*6; i*7 i*8 i*9]; end

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
APP Designer code convert to CPP code
Do you need to generate the C++ code, or is it also fine to end up a stand-alone executable? As the message indicates, UIFigure...

plus de 3 ans il y a | 0

Réponse apportée
Difference between "||" and "&&" in my loop
The or operator means and/or, just like it does in mathematics. You can use the xor function (although no operator or short-circ...

plus de 3 ans il y a | 0

Réponse apportée
How to reduce the file size of a saved histogram figure
You have two options that I'm aware of: # Change the underlying data so you reproduce the same bins with fewer data points. ...

plus de 3 ans il y a | 1

Charger plus