发布日期:2022-8-15 更新日期: 2023-1-10文章字数 0阅读时长:0分钟

type
Post
status
Published
date
Aug 15, 2022
slug
wolfram-sz1
summary
tags
mathematica
category
技术分享
icon
password
Property
Jan 10, 2023 07:41 AM
URL
在传统的编程书上,总是从基础的语法开始讲起,然后把所有知识过了一遍之后才开始正式做东西,这么做的一个巨大的缺陷就是很容易让人劝退,大多数学习者在学习的过程中容易劝退。wolfram 语言同样如此,为了解决这种困境,本文将从实战出发,从实际例子来解决问题,这样学起来更快。
 
第一个例子中,我们将做一个思维导图
Clear["Global`*"]; (*=== data ===*) data1 = 1; data2 = Range[2, 6, 1]; data3 = Range[7, 9, 1]; (*=== vertex ===*) verColor = {1 -> Orange, # -> RGBColor["#c6d8ed"] & /@ data2, # -> RGBColor["#a0b88b"] & /@ data3} // Flatten; (*=== edge ===*) edge1 = DirectedEdge[data1, #] & /@ data2; edge2 = Array[DirectedEdge, {5, 3}, {{2, 6}, {7, 9}}] // Flatten; edge = {edge1, edge2} // Flatten; (*=== graph ===*) Graph[edge, (*-- vertex --*) VertexSize -> 0.7, VertexStyle -> verColor, VertexShapeFunction -> "Rectangle", (*-- edge --*) EdgeStyle -> {Arrowheads[2]}, EdgeShapeFunction -> "Arrow"]
notion image
 

Mathematica 安装和激活 Mathematica 安装和激活
示例文章 示例文章

这是示例的文章摘要,摘要内容可被用做搜索,预览。文章列表默认展示概要;若要在列表直接展示文章内容,可在blog.config.js中配置。