Beantwortet
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,...

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 4

| akzeptiert

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

mehr als 15 Jahre vor | 11

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 2

| akzeptiert

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 3

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 2

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 0

Beantwortet
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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 1

| akzeptiert

Mehr laden