Answered
.p type files
.p files are encrypted files where the plaintext cannot be read or modified. If you were given a pcode file, it is because the ...

15 years ago | 1

Answered
How to vectorize vector indexing?
Another approach: % Data A = [1 2 3 4; 5 6 7 8; 9 10 11 12]; c = [2 3 1]; %Extraction: ...

15 years ago | 4

| accepted

Answered
How to colorize individual bar in bar3
Never say never! Y=[ 1 2 3 ; 4 5 6 ; 3 4 5]; h = bar3(Y); cm = get(gcf,'colormap'); % Use the current colormap. cnt...

15 years ago | 11

| accepted

Answered
MATLAB code help
First thing is to read what comes up when you type this: docsearch('M-file function')

15 years ago | 0

Answered
sinc function
x = -20:0.0001:20; y = (sin(pi*x))./(pi*x); y(x==0) = 1;% If you don't get: (Warning: Divide by zero.) you missed 0. plo...

15 years ago | 2

| accepted

Answered
Do you suffer from keyboard latency in this forum?
I do have such issues, but very inconsistently. Over the last few days it has been driving me nuts. For a few weeks before tha...

15 years ago | 1

Answered
How to plot lines between all these points
Does this do what you need? V(6,:) = V(1,:); % To connect at the end. Assumes size(V,1) = 5; line(V(:,1),V(:,2))

15 years ago | 0

| accepted

Answered
How to replace zeros with other value in a big matrix fast
Don't double call these functions (MAX,MIN,SUM,MEAN,etc.). Learn to use the colon, it is your friend! A(~A(:))=mean(A(:)); ...

15 years ago | 1

| accepted

Answered
Help with speciality dice simulator
From what I can understand, your code could become: function [DieResult Special] = t6(n) D = floor(rand(1,n)*6) + 1;...

15 years ago | 0

| accepted

Answered
retrieving data from a gui
There are many ways to do what you want here. First though, using VARARGOUT does not do what you think it does in this callback...

15 years ago | 1

Answered
inserting headers into a vector
Boris, please format your code and fix the errors. When I tried to copy and paste your code, it looks like you are missing some...

15 years ago | 0

Answered
Validation of a date with a given format
try D = datenum(Inpt,'dd mmm yyyy HH:MM:SS.FFF') catch error('Incorrect Format') end

15 years ago | 3

Answered
matlab data parsing help- pulling only certain characters
Also, Rs = cellfun(@(x) x(21:35),quat1,'Un',0); To convert to doubles, use: Rd = cellfun(@(x) str2double(x(21:35)),qu...

15 years ago | 0

Answered
what is wrong in this code in matlab?
You probably mean to use the SQRT function to find the square root. In response to your clarifying comment, sqr = @(x) x.^...

15 years ago | 0

| accepted

Answered
Numeric solution of a transcendental equation
Please format your code using the {} Code button so that it is readable. Using the modified version of your function below (m...

15 years ago | 0

Answered
passing data into another gui figure window using guide
Did you look at the responses you got to the exact same question here: <http://www.mathworks.com/matlabcentral/answers/5447-p...

15 years ago | 0

Answered
plotting a graph from Mat files.
What does that mean? Does it mean you want to load some of the data stored in a .mat file and then plot that data?

15 years ago | 0

Answered
Is this a switchyarding case?
Here is an example. function [] = Check_examp() % Print to screen the users checkbox choices. S.fh = figure('units','pix...

15 years ago | 0

| accepted

Answered
Generating scalars from Approximate values
Is your matrix actually a row vector? I hope so, or you will have to clarify how an n-by-4 array is to approximate a 1-by-4 vec...

15 years ago | 0

Answered
Efficient way to split a vector into Matrix
IDX = ones(3,5,'single'); IDX(:,1) = 1:3; D = B(cumsum(IDX,2)) Or, to match your functional form: function m_Arr...

15 years ago | 1

Answered
nice boxes for great linewidths
I don't have the correct toolbox so I cannot test these ideas, but two come to mind. I assume that what looks like blue lines i...

15 years ago | 2

Answered
Norm of the difference of each row of two matrices of different dimensions
Did you properly pre-allocate d before the loop? This would be your largest time killer if not... Also, your example loops don...

15 years ago | 1

| accepted

Answered
Imaginary number to a power
No problem here: clear i correct_answer = i^3 % Verify this first! for ii = 1:100000, if ~isequal(i^3,correct_an...

15 years ago | 1

Answered
indexing in nested loop
You might consider a loop counter or two: cnt1 = 0; cnt2 = 0; for a=1:5:101 cnt1 = cnt1 + 1; for b=1:20 ...

15 years ago | 1

| accepted

Answered
passing data between two different gui window using guide
From the second GUI callback which needs the data, simply use: H = findall(0,'tag','myeditboxtag'); Where myeditboxtag i...

15 years ago | 1

| accepted

Answered
Determine the exponential function
To expand on and reinforce Sean de's comment: Simply pasting a homework problem here will not result in its solution. There ar...

15 years ago | 0

Answered
Matrix Averaging
If A is your matrix and tol stands for "a certain average," if mean(A(:,1))<tol M = mean(A(:,2:5)); end

15 years ago | 0

| accepted

Answered
Problem with matlab editor
I don't know what happened to alter this behavior. Does the same thing happen when you have the editor window up and hit ctrl+n...

15 years ago | 0

Answered
Confused: GUI / figure /
The reason why the third attempt doesn't find the GUI is that GUIDE GUIs have their figure handle visibility set to 'callback' s...

15 years ago | 1

| accepted

Answered
Find the roots of an expression
<http://www.mathworks.com/help/techdoc/ref/fzero.html FZERO> can be used to find roots. Dw = 0.0000076; S = 0.000239; r...

15 years ago | 0

| accepted

Load more