首页 > 其他分享 >SCI1022 matlab求解

SCI1022 matlab求解

时间:2023-06-05 14:01:03浏览次数:45  
标签:function sudoku code 求解 SCI1022 puzzles solve matlab Sudoku


MATLAB for SCI1022 assignment 4: Solving Sudoku
This assignment contributes 20% of your final mark for the MATLAB module. To complete the
assignment, write a MATLAB live-script or normal script, and provide a pdf-file with your
results including the figures. Each task needs to be clearly coded in the script, with each task
beginning a separate block within the code.
In this assignment you are solving Sudoku puzzles, using data and functions we used in the
lab classes, and a new function to solve any Sudoku puzzle.
1. Task: Solve Sudoku
Try to solve all 17 puzzles of the data file “sudoku.examples.mat”. Note, that the
puzzles are sorted, with the first the easiest and the last the hardest (see variable lvl,
for the difficulty level of each puzzle). Start your code based on the functions
sudoku_notes0 and sudoku_method_1.
• Present two example solutions for two different Sudoku puzzles.
• Clearly state which puzzles your solution can solve or not solve.
• Explain how your method of solving Sudoku puzzles works.
For solving the first 8 puzzles you will get 3 points. If your code can solve at least one
additional puzzle you will get 4 points.
(4 points)
Notes:
• For this task you are not allowed to use the function sudoku_mathworks or
any code derived from it.
• Your code must follow an algorithm, but not just explicitly provide the solution
for each puzzle hard coded (e.g., if puzzle #8, then solution = xyz).
• Solving all puzzles is very difficult. Try to just improve the current code a little
bit. Even this may be a bit of a coding challenge.
• Using the given functions, you will be able to solve the first 8 puzzles.
• Check the quizzes and worksheets for ideas on how to solve at least one of the
other puzzles.
2. Task: Solve Sudoku #16 and #17
Solve the Sudoku puzzles #16 and #17 using the function sudoku_mathworks.
(2 points)
3. Task: Number of function calls
The function sudoku_mathworks uses a recursive function approach.
• Which line of the codes shows that this code is a recursive function?
• For the puzzles #1, #9, #13 and #17: How many times is the function
sudoku_mathworks called to solve these puzzles?
(2 points)
4. Task: Explain the method sudoku_mathworks
Explain how the function sudoku_mathworks works. What approach is this method
using?
Hint: The function includes the function candidates, which is similar to the function
sudoku_notes0.
(2 points)

 

标签:function,sudoku,code,求解,SCI1022,puzzles,solve,matlab,Sudoku
From: https://www.cnblogs.com/simpleyfc/p/17457599.html

相关文章

  • matlab结构化程序设计流程结构
    一、条件转移结构基本形式:f条件表达式语句段end执行流程:若表达式条件成立,执行语句段,否则跳过语句段的执行。若需要多条件转移,一般是三个或以下:if条件表达式1语句段1elseif条件表达式2语句段2else 语句段3end注意事项:if或else中的语句无需{}包围......
  • m基于ENM-LAP模型的自组织网络平均最短路径长度matlab仿真分析
    1.算法仿真效果matlab2022a仿真结果如下:2.算法涉及理论知识概要移动自组织网络不但具有终端能量受限、无线信道状况受链路距离影响等特点,还具有节点位置的选择存在偏好的规律。本节建立基于节点位置偏好的网络拓扑演进模型,并利用复杂网络理论对其进行分析。网络拓扑结构产生过......
  • m基于节点位置偏好的自组织网络节点度分布的matlab仿真
    1.算法仿真效果matlab2022a仿真结果如下:2.算法涉及理论知识概要​移动自组织(AdHoc)网络是一种多跳的临时性自治系统,它的原型是美国早在1968年建立的ALOHA网络和之后于1973提出的PR(PacketRadio)网络。ALOHA网络需要固定的基站,网络中的每一个节点都必须和其它所有节点直接连......
  • m基于节点位置偏好的自组织网络节点度分布的matlab仿真
    1.算法仿真效果matlab2022a仿真结果如下:     2.算法涉及理论知识概要​      移动自组织(AdHoc)网络是一种多跳的临时性自治系统,它的原型是美国早在1968年建立的ALOHA网络和之后于1973提出的PR(PacketRadio)网络。ALOHA网络需要固定的基站,网络中的每一......
  • 【滤波跟踪】基于matlab实现GPS+IMU数据融合
    ✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。......
  • m基于matlab的WLAN室内无线信道建模与仿真
    1.算法仿真效果matlab2022a仿真结果如下:2.算法涉及理论知识概要室内无线信道是指室内对无线通信中发送端和接收端之间通路。室内无线信道与传统的无线信道相比,具有两个显著的特点:其一,室内覆盖面积小得多;其次,收发机间的传播环境变化更大。研究表明,影响室内传播的因素主要是建筑......
  • m移动通信系统中越区切换算法的matlab仿真,对比MASN,ASUR,OP
    1.算法仿真效果matlab2022a仿真结果如下:2.算法涉及理论知识概要硬切换,就是强制切换,其最大的特点是:“先断后连”。在硬切换过程中,用户移动设备仅仅保持与一个基站链接,一旦切换操作被激活,其马上会切断原有的连接,然后再与新的基站建立连接。从一个基站切换到另个基站的过程中,通信......
  • m基于matlab的WLAN室内无线信道建模与仿真
    1.算法仿真效果matlab2022a仿真结果如下:   2.算法涉及理论知识概要      室内无线信道是指室内对无线通信中发送端和接收端之间通路。室内无线信道与传统的无线信道相比,具有两个显著的特点:其一,室内覆盖面积小得多;其次,收发机间的传播环境变化更大。研究表明,影响......
  • m移动通信系统中越区切换算法的matlab仿真,对比MASN,ASUR,OP
    1.算法仿真效果matlab2022a仿真结果如下:    2.算法涉及理论知识概要       硬切换,就是强制切换,其最大的特点是:“先断后连”。在硬切换过程中,用户移动设备仅仅保持与一个基站链接,一旦切换操作被激活,其马上会切断原有的连接,然后再与新的基站建立连接。从一个基......
  • 信号与系统基础复习:系统分析、求解方程、电路基础
    信息与系统总论信息是人类社会和自然界中需要传送、交换、存储和提取的抽象内容。信息存在于一切事物之中,事物的一切变化和运动都伴随着信息的交换和传送。各种各样的社会活动、无线电波的传播、计算机的运算等都是信息交换和传输的过程。信息是抽象的内容,为了传送和......