Optimizing Code Space analyzing data

I have been using MATLAB for several weeks now, obtaining a basic understanding of the program and how to use it. Through this time I have realized there is an easy way and a hard way to do things. The hardy way usually takes up much more time and involves many more lines of text, while the easy way is simple and to the point. One thing is for sure, I'd much rather take the easy route than laboring for hours writing a code that in theory should have taken me no time at all. For example in a past homework we were told to analyze some data sets from an excel sheet and turn them into a matrix. The code I used was too long and I know there is simpler way so how should I go about fixing this? Thanks
code used %% Analyzation Table table = [mean(age),mean(income),mean(time),mean(health),mean(adl), ... mean(memory),mean(cog_in),mean(soc_sup),mean(burden),mean(satis);... median(age),median(income),median(time),median(health),median(adl),... median(memory),median(cog_in),median(soc_sup),median(burden),... median(satis);std(age),std(income),std(time),std(health),std(adl),... std(memory),std(cog_in),std(soc_sup),std(burden),std(satis);... max(age),max(income),max(time),max(health),max(adl),max(memory)... max(cog_in),max(soc_sup),max(burden),max(satis);min(age),... min(income),min(time),min(health),min(adl),min(memory),... min(cog_in),min(soc_sup),min(burden),min(satis)]'

回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

提问:

2015-2-15

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by