Talk:MATLAB Programming

Page Split
The split is done. Maybe time to clean up this talk page Agriculturist50 (discuss • contribs) 23:07, 23 January 2015 (UTC)

The opening page is too long and some of the ending sections would be considered advanced topics. I propose moving most of the Content below M-file programming into advanced topics. Excluded in the move would be Alternatives to MATLAB, the references section, and the links section.

If anyone wants to add a highly specific task, go to the advanced topics section. It will clog this book up if it is added at the main page Agriculturist50 (discuss • contribs) 15:38, 23 January 2015 (UTC)

Reorganizing
Reorganized for readability. There are multiple alternatives to MATLAB, so just created an entire section for alternatives. It does seem prudent to point out early a free alternative is available. Also found place for operators reference.

Much of what was on the intro page has been split to its own pages. Agriculturist50 (discuss • contribs) 20:35, 12 January 2015 (UTC)

Capitalization
The capitalization MATlab is very odd. The Mathworks web site uses MATLAB.

Template:Matlab CMD
I created this template for use in some books on the Engineering bookshelf. It's just a simple template (for now), that mentions when matlab has a certain feature. You type, and it produces the template at left. -- 22:36, 29 November 2005 (UTC)

more editing
I'm writing several Matlab scripts as part of my course, so I decided to contribute to this wikibook as I go along, since it seems to need a lot of work. This could help my coursemates - so they won't nag me too much asking for help in the problems =P. Any criticisms/assistance on my work would be most welcome. -Arthur

Organizing
This wikibook is getting a bit lengthy, is it possible to break this up into several pages like the other books? Like one section on Graphics, one section on functions, and so on.

Organizing
I've managed to get 'Graphics' into a separate page, although there are a few rough edges to iron out. I'll start moving other sections into their own pages soon, if someone could help me make it look better (seems i'm not doing a very good job, i'm just copying formatting code from other wikibooks) it would be appreciated of course. -Arthur

Organizing 3
File Naming Constraints: This is already under "Saving and Loading a MATLAB file" so I will work on removing the duplication under "examples", since it IMO makes more sense in the saving and loading section anyway. If you agree with me I'll put it up as a speedy delete.

Inserting Single Quotes: This, I think, along with the two NEWLINE topics, can be merged into a single topic, I'm not sure what I would title it though, maybe 'character tricks' or something like that?

A3392: I know you've been doing a lot on this book, so let me know if you disagree with any of the changes I make. Mattb112885 20:43, 31 August 2006 (UTC)

MATLAB, permissions and images
I've been in contact with representatives from The MathWorks about MATLAB. The MathWorks has an entire department dedicated to working with authors of MATLAB-related books. According to a representative from The MathWorks, If we would like to post screenshots of the MATLAB environment or images of MATLAB-generated graphics, we should email a copy of those images to The MathWorks in order to secure the correct permissions, and then we can upload the images here for use in our books. Essentially, by receiving explicit permission to use these images, we can upload screenshots of MATLAB without having to worry about Fair-Use problems.

To that end, I am going to create a Template for tagging MATLAB images that indicates the copyright status of those images, and other information. I am also going to create a category, Category:MATLAB Images that will contain a cannonical list of all images that were released for use in Wikibooks under this program.

For further information about this, please send me a message on my user talk page. --Whiteknight (talk) (projects) 19:51, 12 December 2006 (UTC)
 * Category missingDoorknob747 (discuss • contribs) 19:49, 19 March 2015 (UTC)

Octave *and* matlab programming
The title itself emphasizes only the proprietary (and expenseive) matlab application.

While it is written that Octave is nearly a clone, and that most would apply to both, I think it would make a lot of send that the title be changed to "Octave and matlab programming" that stresses the fact that one is very close to the other. For differences, eg. graphics, some could be done with matlab and other with octave. Some special inputs could also be written to help overcome the differences, eg. doing some graphics in octave with the add-on like octaviz or matplotlib that make it very similar and inteactive too. Thanks --npettiaux 07:54, 18 December 2006 (UTC)


 * Though the two are very similar, I think the majority of people would be looking simply for MATLAB (just by virtue of the fact that more people use that than Octave in institutions etc.), and I think also that it would be easiest just to make a redirect from the "Octave programming" page to the MATLAB programming page to accommodate those who do happen to search for Octave. Actually, I'll do that after I post this. I do agree however that it would be useful to make note of some of the differences in the book. I myself am not familiar enough with Octave to know major differences between them but I think if you would like to write something about them they would surely have a welcomed place here. Mattb112885 15:57, 18 December 2006 (UTC)


 * I'm in agreement with Mattb here, Octave is similar to Matlab, but it isn't perfect compatability. Matlab also has a number of features that arent supported in Octave, and if we want to be comprehensive, we will essentially end up writing two separate books on these two programs, with some overlap. Instead of redirecting Octave Programming to here, I would recommend, instead that we create a separate book for Octave. We can crosslink between the two books where needed. --Whiteknight (talk) (projects) 18:52, 18 December 2006 (UTC)


 * After discussion on the Octave-help mailing list, we considered that as Octave has been conceived as a MATLAB clone, most differences can be considered as bugs. Therefore, Octave programming is due to be identical and the best would propably be in a separate chapter explaining the differences and the comparison. Therefore, differences and comparison between MATLAB and Octave are presented in Comparison Octave / MATLAB. --npettiaux 15:07, 30 January 2007 (UTC)


 * I hope you don't mind, i've renamed this page you created to be MATLAB Programming/Comparing Octave. The page that you had created wasn't technically "in" this book, and that causes some problems. Separate chapters would be a fine solution, and it would even be perfectly acceptable to use templates in the main body of the text to point out any incompatabilities as they arise (such as this template to the right). --Whiteknight (talk) (projects) 15:13, 30 January 2007 (UTC)


 * Thank you for your comment and correction and the inclusion of the page in the book. We shall work on them, and them delete the "octave wikibook" that has no need to remain. How can we use the nice template on the right to show the differences ? --npettiaux 15:18, 30 January 2007 (UTC)


 * If you want to delete the octave programming book, Im not sure if it would qualify as speedy (probably not since the original page had multiple authors), you can list it under votes for deletion and if you want to I can put the template on there. I doubt there'd be too much argument since its a lot of red links right now anyways. Nice template Whiteknight, I think that'll fit nicely. I'll change the format of the main page slightly to make it fit more with the rest of it (for example, moving the link from the title of the chapter to below it, since none of the other chapters is a link) but I think it's a good idea to have some pages about Octave, and just link to them in the template like Whiteknight proposes. Mattb112885 22:05, 30 January 2007 (UTC)

Thanks to Whiteknight a quick template can be used for octave differences, defined in Template:MATLAB/Octave. you can insert this template into the book by typing:

Where " " will be an optional explanation that you can add for clarity. --npettiaux 23:10, 30 January 2007 (UTC)

Struct arrays
There exists a red link for struct arrays already, was the module you created meant to be Octave-specific? If it is, I propose moving the link to the "octave" section.

If not we can put it where the redlink is now (AFAIK struct arrays have nothing to do with object-oriented programming) and change the references to Octave to references to MATLAB. I think that the book should be centered around MATLAB except for the sections that are specific to Octave. The book is MATLAB programming, and Octave is the clone of MATLAB, not the other way around. In addition all references already existing are references to MATLAB. Finally, I think there is already a note on the page that most statements about MATLAB are also true in Octave, and the differences can be noted explicitly with Whiteknight's template, so we might as well keep the references consistent within the whole book. Let me know what you think. Regards, Mattb112885 02:35, 2 February 2007 (UTC)

Statistics
Is it possible to include a Statistics chapter in this book? Albmont (talk) 19:15, 18 August 2008 (UTC)

Conditional Operators
There should be a section that contains a list of conditional operators in MATLAB for reference purposes.--99.16.58.18 (talk) 21:04, 25 April 2009 (UTC)

I/O
Where is the information on I/O? There is a chapter for usb and serial port I/O but no information about file I/O for things such as text files. Maybe it is there and I just can't find it. I suggest making it more obvious if it is there, and if it's not add some info about it. Rhollis7 (talk) 23:28, 18 October 2010 (UTC)


 * ✅. The MATLAB Programming section has a link to MATLAB Programming which seems to have all the info you need to read and write text files. Feel free to make that link more obvious. --DavidCary (discuss • contribs) 01:31, 18 November 2012 (UTC)

clear
I don't know if this is an old syntax, but it doesn't work on MATLAB 8.3. Instead, the documentation suggests clear var1 var2 which works.

=Old Comments=

Octave
no mention of GNU Octave? - Omegatron 02:44, 17 August 2005 (UTC)

Not sure what this is, but it was on intro page
This was on the intro page. Someone might have been trying to do something with it at one time, but did not clarify what.

clc; clear all; close all;

[filename, pathname] = uigetfile( {'*.jpg';'*.bmp'}); aa=imread([pathname,filename]); I=aa; bb=imresize(aa,[256 256]); imshow(bb);title('input image');

%%...............%%% RGB2Lab color conversion %%%.........

rgbimage=makecform('srgb2lab'); labimage=applycform(bb,rgbimage); figure, imshow(labimage);title('color conversion image');

%%..............%%% seperate L* a* b* color space %%%.........

L=im2double(labimage(:,:,1)); a=im2double(labimage(:,:,2)); b=im2double(labimage(:,:,3)); figure,imshow(L);title('L* image'); [h,w,o]=size(L);

%%..........%%% applying filter in L* color space %%%..........

for s=1:3 W(s)=h/2^s; for i=1:h for j=1:w p=(i-W(s)); q=(i+W(s)); r=(j-W(s)); t=(j+W(s)); if p<=0 p=1; end if q>256 q=256; end if r<=0 r=1; end if t>256 t=256; end m=p:q; n=r:t; %N(s)=W(s)*W(s); N(s)=size(m,2)*size(n,2); sum1=sum(sum(L(m,n))); V=1/N(s); A=V*sum1; B(i,j)=L(i,j)-A; end end %B=L-A; %figure,imshow(B); azx(:,:,s)=B; end

contrast_L=azx(:,:,1)+azx(:,:,2)+azx(:,:,3); figure,imshow(contrast_L),title('contrast map L* image');

%%..............%%% find inverse of a* %%%............

figure,imshow(a);title('a* image'); d=max(max(a)); yy=d-a; yy=(yy*5); figure,imshow(yy);title('inv a* image'); [h,w,o]=size(yy);

%%.............%%% applying filter in a* color space %%%........

for s=1:3 W(s)=h/2^s; for i=1:h for j=1:w p=(i-W(s)); q=(i+W(s)); r=(j-W(s)); t=(j+W(s)); if p<=0 p=1; end if q>256 q=256; end if r<=0 r=1; end if t>256 t=256; end m=p:q; n=r:t; %N(s)=W(s)*W(s); N(s)=size(m,2)*size(n,2); sum1=sum(sum(yy(m,n))); V=1/N(s); A=V*sum1; C(i,j)=yy(i,j)-A; end end %C=L-A; %figure,imshow(C); aza(:,:,s)=C; end

contrast_a=aza(:,:,1)+aza(:,:,2)+aza(:,:,3); figure,imshow(contrast_a),title('contrast map a* image');

%%.............%%% find final scaling contrast map %%%.......

Scaling_contrast=imadd(contrast_L,contrast_a); figure,imshow(Scaling_contrast),title('Scaling contrast map');

%%...........%%% gabor filter outputs %%%.......................

[gabor_timage,u,v,GT,filter]=final_gabor(aa);

%%..........%%% removing erythema & dark pixels %%%..........

ts=0.4;                                %% set threshold value R=Scaling_contrast; for i=1:h for j=1:w if Scaling_contrast(i,j)>=ts R(i,j)=1; else R(i,j)=0; end end end

figure,imshow(R);title('Removing erythema');