Respondida
Generating array of data using for-end looping
Another non-loop alternative (edit logspace): mylogspace = @(x1,x2,n) 10.^ [x1+(0:n-2)*(x2-x1)/(n-1), x2] mylogspace(0,9.5,...

más de 15 años hace | 1

Respondida
.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 ...

más de 15 años hace | 1

Respondida
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: ...

más de 15 años hace | 4

| aceptada

Respondida
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...

más de 15 años hace | 11

| aceptada

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

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 2

| aceptada

Respondida
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...

más de 15 años hace | 1

Respondida
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))

más de 15 años hace | 0

| aceptada

Respondida
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(:)); ...

más de 15 años hace | 1

| aceptada

Respondida
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;...

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 0

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

más de 15 años hace | 3

Respondida
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...

más de 15 años hace | 0

Respondida
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.^...

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

Respondida
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?

más de 15 años hace | 0

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

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 2

Respondida
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...

más de 15 años hace | 1

| aceptada

Respondida
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...

más de 15 años hace | 1

Respondida
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 ...

más de 15 años hace | 1

| aceptada

Respondida
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...

más de 15 años hace | 1

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 1

| aceptada

Cargar más