Matlab | Matlab从入门到放弃(7)——struct结构体
生活随笔
收集整理的這篇文章主要介紹了
Matlab | Matlab从入门到放弃(7)——struct结构体
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
博主github:https://github.com/MichaelBeechan
博主CSDN:https://blog.csdn.net/u011344545
代碼下載:https://github.com/MichaelBeechan/Matlab-From-Zero-To-One
%% Time:2019.5.27
%% Function:average value 動態字段名稱 結構體
avgscore.m
function avg = avgscore(testscores, student, first, last) testscores.Ann_Lane.week(1:25) = ...[95 89 76 82 79 92 94 92 89 81 75 93 ...85 84 83 86 85 90 82 82 84 79 96 88 98];testscores.William_King.week(1:25) = ...[87 80 91 84 99 87 93 87 97 87 82 89 ...86 82 90 98 75 79 92 84 90 93 84 78 81]; for k = first : lastscores(k) = testscores.(student).week(k); end avg = sum(scores)/(last - first + 1); end結構體
%% 結構體 S 與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的Matlab | Matlab从入门到放弃(7)——struct结构体的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Matlab | Matlab从入门到放
- 下一篇: Matlab | Matlab从入门到放