Main Content

Results for


If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,...N i.e. the expected value of one die. For example, the expected value of a 6-sided die is 3.5.
Given N, simulate 1e8 N-sided dice rolls by creating a vector of 1e8 uniformly distributed random integers. Return the difference between the mean of this vector and the mean of integers from 1 to N.
function dice_diff = loln(N)
A=randi([1,N],1e8,1)
M=mean(A)
B=1:N
m=mean(B)
dice_diff =abs(M-m);
end
Here is my code, but it can't work out as it needs too long time to creat A.

can anyone advise which Matlab code I can add to the below codes to have Spectrogram Plot?

OptimalValuesx1y1z1 = [dataArray{1:end-1}];
%% Clear temporary variables
clearvars filename delimiter formatSpec fileID dataArray ans;
re=1;
fs=20e3/re;
datatable=OptimalValuesx1y1z1;
datatable=resample(OptimalValuesx1y1z1,1,re);
%datatable=lowpass(OptimalValuesx1y1z1,10,fs);
datatable(:,2)=datatable(:,2).*0.01;
figure
t=1/fs:1/fs:length(datatable)/fs;
plot(t, rms(datatable(:,2:4)*9.81,3));
ylim([0 10])  
xlim([0 10])
%ylim([0 1])
hold on
%plot(t,ones(1,length(datatable(:,2:4)*9.81))*12,'r--')
xlabel('Time [s]')
ylabel('Amplitude [m/s^2]')
legend('axis X','axis Y','axis Z','limit')
out_mean = mean(rms(datatable(:,2:4),3))
std_mean = std(rms(datatable(:,2:4),3))
% %PSD analysis
figure
x=datatable(:,2:4)*9.81;
nbar = 4;
sll = -30;
win = taylorwin(length(x),nbar,sll);
periodogram(x,win,[],fs);
xlim([0 1.624])
legend('axis X','axis Y','axis Z')

plz tell me the web site where i can easily install mathlab.

I want to use the Image fusions and deep neural network to detect the Corona-virus (COVID-19)

Created and tested in the university classroom, the Introduction to MATLAB zyBook includes automated assessment using MATLAB Grader. Learn how to create custom MATLAB assignments using zyLabs and provide feedback.

Join this webinar running April 21st and 23rd

Here is a great video from Gartner in response to COVID-19 and trends they are seeing for schools transitioning to Distance Learning. We hope this is helpful! See here: Gartner Research

I organized in September 2019 a one-week workshop in a hybrid set-up (students could attend the workshop either on-site or fully on-line). Beyond the hybrid nature of the workshop, the workshop was "flipped": the workshop attendees had to study some handbook specifically written for the workshop, watch some short videos summarizing the main concepts and answer online quizzes. During the workshop, most of the time was spent on hands-on coding exercises and assignments, during which the workshop attendees had to apply the concepts presented in the handbook and videos.

All coding exercises and assignments were carried out with MATLAB Grader. The platform provided the same coding environment to all workshop attendees, irrespective of whether they attended the workshop on-site or remotely. Furthermore, by providing a coding template and rigorous assessment tests along each exercise, having all students converging to the right "solution" was painless. It allowed me, as a teacher, to entirely focus on helping the students in solving those exercises, which was extremely rewarding.

This teaching set-up, combined with smart IT solutions as e.g MATLAB Grader, favors deep student learning, since the students learn by doing (active learning) and are continuously supported by the teacher in their learning.

I will soon teach in another course along the same principles. The course was supposed to be given on-site only, but because of the outbreak of Covid-19, it will be given entirely online. Thanks to MATLAB Grader, the migration to a online set-up is straightforward.

In case you want to read more about some of my past efforts in the development and application of student-centred pedagogical approaches, you can read more about those at: https://www.chalmers.se/en/departments/physics/news/Pages/Teaching-the-algorithms-that-are-crucial-for-nuclear-reactor-modelling.aspx and https://www.chalmers.se/en/departments/physics/news/Pages/Online-educational-efforts-to-ensure-nuclear-safety.aspx

I will also be glad to answer questions and provide help to those of you who want to get started with online teaching.

Christophe

This Coursera course teaches computer programming to those with little to no previous experience: https://www.coursera.org/learn/matlab

Your students might find this course a useful introduction to programming.

I took a course on Medical Image Processing from one of the instructors, Prof Mike Fitzpatrick, when I was a graduate student at Vanderbilt University a few decades ago. He's a great instructor who helped get me hooked on MATLAB for learning, teaching and researching!

There’s a webinar on online learning tools with MATLAB this Friday. It’s for time zones in Asia Pacific.

Register if you’re interested!

Hi I want to track a animal in my recorded video. I tried computer vision toolbox but it is not very accurate for this type of tracking. The recording is from top and the animal runs in a maze. I want to track body and head. The next step is classifying the movements in video using deep learning but again we do not have a trained network.

iam working with rgb fundus images my task is to convert the rgb image to hsv space and extract the channels and perform brightness correction in the image now i am little confused on how to extract the channels of the corrected image the corrected image is not saved as jpg format could anyone help me to solve this issue i have also attached the coding thank you in advance

Looking for solutions to move your course online? zyBooks and MathWorks have teamed up to provide free access to the Introduction to MATLAB zyBook for the remainder of the Spring 2020 semester.

This web-based book presents a comprehensive introduction to MATLAB through interactive questions, animations, and automated MATLAB assessment. Benefits include:

  • Access the textbook, homework, and practice from one location
  • Put theory into action through an engaging, learn-by-doing approach
  • Improve student learning with instant, contextual feedback
  • Save time grading with automated MATLAB assessment using MATLAB Grader
  • See real-time analysis of class and student performance
  • Create custom MATLAB assignments using zyLabs
  • Use proven, prebuilt interactive questions and animations

Learn more at: https://www.zybooks.com/covid-19-care-package/

MATLAB Online lets students run MATLAB without having to install the software on the computer. All you need is a web browser and an internet connection.

I would love to hear comments and experiences of using MATLAB Online.

The Webinar has ended, but you can view the recording here on YouTube.

MathWorks has developed several cloud-based tools to enable instructors and students to have access for teaching and learning anytime, anywhere. Join us for a free webinar with Dr. Elvira Osuna-Highley where we’ll discuss these tools, how they fit together to support your course development and delivery workflow, and how to use them immediately in your online course.

We will discuss several resources including:

• Accessing MATLAB Online and MATLAB Drive Anytime, Anywhere

• Leveraging interactive content with self-paced courses, MATLAB Apps, and Live Scripts

• Mentoring students at scale with automated assessment and feedback in MATLAB Grader

• Connecting students with the community by participating in the MATLAB user community

Thank you to IFEES, GEDC and IUCEE for sponsoring this series to help support educators across the world in moving their courses online.

Chad Allie
Chad Allie
Last activity on 30 Mar 2020

Hello Distance Learning Community!

I am hoping to hear from any academics in how MATLAB's online resources have helped you during this difficult time of transition to online courses:

- Have you had any issues or difficulties with getting started with our online tools?

- Do you see any areas of improvement that could better serve your course in an online environment?

- Do you have any stories to share of how these online tools have helped you to run your class and improve it for the future?

Thank you and stay well!

Chad Allie

Education Customer Success (USA Southwest)

Hello everyone,

I’m Jiro, and I’m part of the Education Customer Success group at MathWorks. We help academics, students, and institutions achieve success through the use of our tools. I will be the moderator for this new community of distance learning.

As many academic institutions are moving their classes online, we hope that this community will help instructors connect with others who are in the same situation. This community site gathers various resources and information that will be useful for teaching with MATLAB and Simulink in a distance learning setting. We have a number of MathWorks employees monitoring this community, but we want this to be a place for the community to come together. The hope is that the community will grow and the resources gathered here will grow with it.

I encourage you to share best practices ( Discussions ), ask questions ( MATLAB Answers ), and share examples ( File Exchange ).

As a first question, what course are you teaching (or planning to teach) online?

In problem 16 I used the following solution:
function b = nearZero(a)
b = max(a(imdilate(a == 0, [1 1 1])));
end
It is working pretty well on mathlab but when I submit my answer to cody, the following error is generated:
Undefined function 'imdilate' for input arguments of type 'double'.
Error in nearZero (line 2)
b = max(a(imdilate(a == 0, [1 1 1])));
Error in Test1 (line 3)
assert(isequal(nearZero(a),b))
In number 5, its written that the correct answer is c = 1 but the secomnd person has more change than the first person, therefor the correct answer should be 2.Likewise in number 6.
Hi, I'm trying to solve this problem but I'm getting an error so far.
Problem:
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have
a = [1 2 2 2 1 3 2 1 4 5 1]
The answer would be 2, because it shows up three consecutive times
What I've written so far (not done):
a = [1 2 2 2 1 3 2 1 4 5 1];
[x,y] = size(a);
counter = zeros(1,10);
if x == 1
for i=1:1:y
if a(i) == a(i+1)
counter(a(i)) = counter(a(i))+1
end
end
else
for i=1:1:x
if a(i) == a(i+1)
counter(a(i)) = counter(a(i))+1
end
end
end
But it says "error" in the line of "if a(i) == a(i+1)". I noticed that it creates a variable called "i" which value is 11, but it should create a vector from 1 to 11. What's wrong here?
I know my solution might not be in the right direction or something, but please don't tell me anything!
Thanks in advance
Jan
Jan
Last activity on 4 Oct 2024

After reading Rik's comment I looked for a list of Matlab releases and their corresponding features. Wiki: Matlab contains an exhaustive list, but what about having a lean version directly in the forum?
If this is useful, feel free to expand the list and to insert additions. Thank you.