Réponse apportée
How can i plot this function? y=0.75/(log10(x)*2).^2
How about this? x = linspace(0.01,0.99,100); % Avoid tricky inputs like 1 y = 0.75./(log10(x)*2).^2; plot(x,y)

plus de 3 ans il y a | 0

Réponse apportée
Why aren't the first and last peaks detected using findpeaks()?
For vec1, the reason is that the peak is also the last data point and so is intentionally exlcuded. The findpeaks documentation...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
sin(2*pi) vs sind(360)
If you ever need to compute sin(x*pi) or cos(x*pi), its better to do sinpi(x) or cospi(x). You never explicitly multily x by a ...

plus de 3 ans il y a | 2

Réponse apportée
Why in matlab sin(pi) is not zero but sin(pi/2) is 1?
If you ever need to compute sin(x*pi) or cos(x*pi), its better to do sinpi(x) or cospi(x). You never explicitly multily x by a ...

plus de 3 ans il y a | 2

Publié le


sinpi, cospi, implicit expansion and The 2022 MATLAB Mini-Hack
The 2022 MATLAB Mini-Hack is currently underway where MATLAB users submit 280 characters of code in order to produce a cool...

plus de 3 ans il y a

Thumbnail

Publié le


How Well Can I Draw a Circle? A MATLAB Adventure
Today's guest blogger is Rob Holt, who works at MathWorks in Natick, Massachusetts. Rob currently serves as the Manager for...

plus de 3 ans il y a

Thumbnail

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

plus de 3 ans il y a

Réponse apportée
Is there any concept like dictionary or hash tables in matlab like in Python?
As of R2022b, MATLAB has a new dictionary datatype An introduction to dictionaries (associative arrays) in MATLAB » The MATLAB B...

plus de 3 ans il y a | 9

| A accepté

Réponse apportée
How to make dictionary in Matlab
In R2022b and later, you can use the new dictionary type for this. Faster than containers.map. A tutorial-like introduction at...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Dictionaries of Hashtables in MATLAB?
Reviving this thread in 2022 because R2022b contains a new dictionary data type. A tutorial-like introduction at An introductio...

plus de 3 ans il y a | 1

Réponse apportée
Faster alternative to containers.Map
MATLAB R2022b has a new dictionary datatype that's much faster than containers.map. A tutorial-like introduction at An introduc...

plus de 3 ans il y a | 0

Publié le


An introduction to dictionaries (associative arrays) in MATLAB
Dictionaries are one of the many new features of MATLAB R2022b which was released yesterday. Today I'll take a look at some...

plus de 3 ans il y a

Thumbnail

Réponse apportée
how to remove/kill the figure produced with colormap
If the colormap is the most recent command you've executed, it will be the current figure. As such, you can use delete(gcf) W...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How do I know how large an array can fit on the GPU?
As you've seen, gpuDevice() gives you information about your GPU. This is what I get for mine >> gpuDevice() ans = CUDA...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
process based parpool: keep the data in the workers
Parfor is great, it auto-parallelises for us and takes care of a lot of things like data transfer to/from workers and so on. At ...

presque 4 ans il y a | 0

Publié le


Linear Algebra in MATLAB: Trying out AMD’s AOCL
In R2022a, MathWorks started shipping AMD’s AOCL alongside Intel’s MKL in MATLAB.  This article explains what these are...

presque 4 ans il y a

Thumbnail

Publié le


R2022a was MathWorks biggest release ever
Every day, over 5000 MathWorkers start their work day thinking ‘How can I contribute to the acceleration of engineering and...

presque 4 ans il y a

Thumbnail

Publié le


[6 3 7 8 5 1 2 4 9 10] – or “A Story of Surprise About Randomness”
Back in late March, Tom Rhys Marshall discovered something about MATLAB’s handling of random numbers that he found both...

presque 4 ans il y a

Thumbnail

Publié le


How to make a GPU version of this MATLAB program by changing two lines
In his article, A short game of Life, Steve Eddins showed us the following few lines of code that impemented Conway's game...

environ 4 ans il y a

Thumbnail

Réponse apportée
using matlab compiler to read a .mat file at run time
You can tell the compiler to exclude things using an Exclude pragma A demo: I created a .mat file as follows myvar = 1; save(...

environ 4 ans il y a | 1

| A accepté

Publié le


Finding if all elements of a matrix are finite, fast!
Today, I'm going to focus on three new functions that were added to the MATLAB programming language in R2022a: allfinite,...

environ 4 ans il y a

Thumbnail

Réponse apportée
Is MATLAB supported on Apple Silicon Macs?
Blog post on this topic at Exploring the MATLAB beta for Native Apple Silicon » The MATLAB Blog - MATLAB & Simulink (mathworks.c...

environ 4 ans il y a | 2

Publié le


Exploring the MATLAB beta for Native Apple Silicon
Update 8th December 2022: You may be interested in the newer Apple Silicon beta that’s discussed at Playing with the R2022b...

environ 4 ans il y a

Thumbnail

Publié le


Welcome to The MATLAB Blog
In the last post of her long running blog, ‘Loren on the Art of MATLAB‘, Loren Shure mentioned that I’d be continuing the...

environ 4 ans il y a

Thumbnail

Réponse apportée
Anderson Darling Goodness-of-the-fit test?
The statistics toolbox has an adtest function. It can test against a specific distribution with known parameters, or a more gene...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Using Parfor for solving ODE via numerical methods (Euler)
As others have said, you cannot parallelise this loop. However, what you can do is parallelise independent runs of this loop. ...

environ 4 ans il y a | 1

Réponse apportée
OCR on a screenshot
Hi Paolo Just because I am MathWorks staff doesn't mean anything here because until right now I've never used MATLAB's ocr func...

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
i dont get why it says Unrecognized function or variable 'Nbin when i run it
It's because you have this line [count,center]=hist(x,Nbin); Nbin needs to be defined as the number of bins you want in the hi...

plus de 4 ans il y a | 0

Réponse apportée
I would like to plot two bar charts side by side using separate y-axis for each corresponding plot.
Try tilledlayout. Documented at Create tiled chart layout - MATLAB tiledlayout (mathworks.com) % I want one row of plots with...

plus de 4 ans il y a | 0

| A accepté

A résolu


Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

plus de 4 ans il y a

Charger plus