Answered
can this loop be vectorized?
I'm seeing a slight (1.25ish times) speedup with the bsxfun approach function speedyhypot() X = repmat(0:5:1000,201,1); Y...

12 years ago | 1

Answered
matrix C from A and B
Or use |setxor| >> C = setxor(A,B,'rows')

12 years ago | 0

Answered
How to check if a 3d matrix has any 2D submatrix with non zero elements?
pagesWithNonZeros = squeeze(any(any(x,1),2)) You can pass _dim_ into |any| to test if there are any nonzero elements in tha...

12 years ago | 1

| accepted

Answered
Traveling salesman intlinprog function in 2013b
If your company/agency/university is current on SMS then you should be able to upgrade to R2014a at no additional cost.

12 years ago | 0

Answered
In Matlab when issuing a custom warning, the message-id is not being recognized. How do I correct this?
It doesn't like the hyphen: warning('Custom:data_missing','Can''t access Customer Terms for data point #%d.',i)

12 years ago | 0

| accepted

Answered
sum values of histogram bins
Building on The Cyclist's answer, use |accumarray| to do the summing: x = randn(100,1); edges = -10:10; [~, idx] = histc(...

12 years ago | 0

| accepted

Answered
Help for codes about strength of materials.
This is just the initialization code for a GUIDE generated user interface. It looks like someone started a new user interface w...

12 years ago | 1

| accepted

Answered
How to force matlab to save before exit?
Inside of your <http://www.mathworks.com/help/releases/R2014a/matlab/ref/finish.html |finish.m|> file, you can save the files us...

12 years ago | 0

| accepted

Answered
How do I change the font size for text in my figure?
I think what you want to do is set the _'Default'_ font size for the axes set(gca,'DefaultTextFontSize',18) Now any text...

12 years ago | 3

Answered
Chnage number display format
How are you writing it right now? If you are using |fprintf| you can change the format spec. For example: fprintf(1,'%10....

12 years ago | 0

Answered
Viewing answers numerically from pdetool box
Under the file menus the bottom option is always export the relevant data: <</matlabcentral/answers/uploaded_files/13204/Capt...

12 years ago | 0

| accepted

Answered
Suppress callbacks generated by GUIDE
I don't believe so. You can always retroactively delete the callbacks in the property inspector and in the generated MATLAB f...

12 years ago | 1

Answered
undefined function or method 'ocr' for input arguments of type 'unit8'
|ocr| was released in the Computer Vision System Toolbox in R2014a so if you are on an older release or don't have CVST, you wil...

12 years ago | 1

Answered
How can I return a char of object variable name from a method
Why not just store it as a property? *More* If it ONLY needs to work from _one_ method calling _oneother methods (i.e. not...

12 years ago | 1

| accepted

Answered
New to MATLAB - How to use imread/imshow commands?
You need to put the string in quotes. Also not sure about the double \\ I = imread('C:\Users\username\Desktop\untitled.png...

12 years ago | 0

| accepted

Answered
How to implement TSP?
<http://www.mathworks.com/help/releases/R2014a/optim/ug/travelling-salesman-problem.html>

12 years ago | 0

Answered
matrix , rows , selection , help
C = A(ismember(A(:,1:2),B,'rows'),:)

12 years ago | 0

| accepted

Answered
index exceed matrix dimension error
dbstop if error Will stop when the error occurs so you can inspect every variable at the time of the error. It should then...

12 years ago | 0

Answered
Can a PhD student use Matlab's student version?
You should absolutely talk to your University's MathWorks' Account Manager. In general most of us technical folks on here won...

12 years ago | 0

| accepted

Answered
To take parameter of a fit from one section to use in another fit in the next section.
% Sample data x = (1:10).'; y = cumsum(rand(10,1)); % First fit ft = fittype(@(m,b,x)m.*x+b); fr = fit(x,y,ft) ...

12 years ago | 0

| accepted

Answered
GPU programming with MATLAB
You should probably discuss your requirements with your friendly MathWorks Account Manager.

12 years ago | 0

Answered
Can Matlab (Windows) display 10 bit images on a 10 bit monitor using a suitable graphics card?
This depends on the renderer. It looks like OpenGL can handle it, painters cannot. hfig = figure; surf(peaks); colormap(...

12 years ago | 0

| accepted

Answered
How can I define f(x) = x/x in MATLAB (Symbolic Computation)
MuPad can handle a function like x/x without automatic simplification. I'm not sure why you want this though. Why do you care ...

12 years ago | 1

Answered
axes doesn't work in matlab 6
Set the figure's _'HandleVisibility'_ to be _'on'_. set(fig,'HandleVisibility','on')

12 years ago | 0

| accepted

Answered
Is there a way to suppress command outputs to command window?
evalc('yourmainfile');

12 years ago | 7

Answered
How to use find function to find consistent value in column?
Look at |diff()| This will tell you the difference between rows.

12 years ago | 0

| accepted

Answered
Integration of displacement to velocity then acceleration
Don't you mean take the derivative of displacement with respect to time to get velocity and again for acceleration? doc dif...

12 years ago | 0

| accepted

Answered
Creating a hard link among properties of an object?
A couple of thoughts Why not just make AllVariables a dependent property. Then every time it's queried it's calculated on th...

12 years ago | 0

| accepted

Answered
if statements concerning vectors
if probabilitiesWanted == 2 swtNPVProb(3:10) = nan end

12 years ago | 0

Answered
Compiled uitable crashes in standalone application
Use a |drawnow| as you have. This will flush the event queue which will force MATLAB to hold until this happens regardless of h...

12 years ago | 0

Load more