已回答
how to select certain elements from a matrix?
B=[90,0,40,0; 0,0,10,60; 55,15,0,10; 0,15,5,0]; [col row]=find(B==0); A= [row col] % coordinate...

10 years 前 | 0

| 已接受

已回答
trouble with complicated loop
% You are playing with two differet indeces: _i_ and _M_. % You have to fix _i_ and then perform the summation: x=ra...

10 years 前 | 0

| 已接受

已回答
how to show my output data in map.
you could take a look at the demos within Matlab documentation. You will find many working examples on data representation, like...

10 years 前 | 0

已回答
how to make sum of (for loop)
the _for loop_: a = 3; % or whatever value you have in mind b = 2; % or whatever value you have in mind n = 10; % or ...

10 years 前 | 0

已回答
Extract data from excel using heading
[data headings] = xlsread('your_excel.xls'); headings = headings(1,:);% first row of headings, in case you have some others...

10 years 前 | 0

| 已接受

已回答
Compare two columns in a matrix, perform if statement.
Your sample data is not very useful, but I think you are trying to do something like this: %sample data A=[-0.758061618...

10 years 前 | 0

| 已接受

已回答
Need help to form equations
a = rand(1,4); % your a matrix syms v1 v2 v3 v4 S = solve( a(1)*v1^2-a(2)*v2-a(3)*v3^2-a(4)*v4==0,... a(3)*v3^2-a(4)...

10 years 前 | 0

| 已接受

已回答
How to combine 2 for loops
You were not very clear in your explanation, but I think you want this: id = [ 1 3; 2 6; 3 2; 4 5; 5 1; 6 4; 7 7]; c...

10 years 前 | 1

| 已接受

已回答
button in a figure
try this: S.f = figure; S.h=plot(rand(10,1)); % creates a figure and plot something on it % create a pushbtton ( adapt i...

10 years 前 | 1

已回答
how to correctly prompt user to enter only 1 real number,numeric value,that is within range...?
A=input('please enter only 1 number and make sure its in range: ','s'); while (isnan(str2double(A)) || str2double(A)<=4 ||...

10 years 前 | 1

| 已接受

已回答
Reduce the size of a vector
vect_45 = rand(1,45000); % your 1x45000 array vect_36 = vect_45(:,1:36000); vect_27 = rand(1,27000); % your 1x27000...

10 years 前 | 0

已回答
Waterfall plot of a time series data
You can use _ncread_ to access your data within the netcdf file. ( From MATLAB documentation ) ncdisp('example.nc','peaks'...

10 years 前 | 0

已回答
how to convert the solid line into dashed line in the images during overlay of images
h = plot(rand(10,1)); % this creates a handle to the figure set(h,'LineStyle','--') % this convert the solid line into ...

10 years 前 | 0

| 已接受

已回答
Tic toc command giving erroneous result
The time taken to run both scripts are insignificantly different. There are only two lines of code of difference between them: ...

10 years 前 | 0

已回答
Curve fitting for power equation
Use the curve fitting tool cftool % this will open the curve fitting tool interface From the user interface, select you ...

10 years 前 | 0

已回答
when two individual number remain in one cell such as a cell contain [300;350]. then how can i extact a single value from the cell?
To extract elements form a cell: p{1}(1) % this will return first element of first cell p{3}(2) % this will return secon...

10 years 前 | 0

| 已接受

已回答
how to create world file
If you mean _Word_ instead of _World_: Publish the file in Microsoft Word format. publish('Your_file.m','doc');

10 years 前 | 0

已回答
How to print the first 100 primes including 1 as a vector
p = [1 primes(100)] p = Columns 1 through 19 1 2 3 5 7 11 13 17 19 23 ...

10 years 前 | 0

| 已接受

已回答
How do I measure mean of every 10 data of a vector size 1x1500?
A = rand(1,1500); % your data M = zeros(1,150); % MEAN MATRIX for k=1:150 M(k) = mean(A(((k-1)*10+k):10*k)); e...

10 years 前 | 0

| 已接受

已回答
How to intersect these lines?
I give you the code for two lines, you extend it to three (do it by pairs if true % code end): %For...

10 years 前 | 0

已回答
How can we Plot a line passing through two points?
If you want a line connecting A and B: A = [2 3]; B = [4 5]; plot(A,B,'*') axis([0 10 0 10]) hold on line(...

10 years 前 | 3

| 已接受

已回答
why can't i plot this function? :(
Try it this way: x = -5:.1:5; y = -5:.1:5; [x1 x2] = meshgrid(x,y); G2 = -(1+cos(12.*sqrt(x1.^2+x2.^2)))./(0.5.*...

10 years 前 | 0

| 已接受

已回答
is it posible to create matrixplot for several data types?
I think -plotmatrix-does not have the option of holding the plot to add extra data. You can use _plot_ and _hold on_ instead: ...

10 years 前 | 0

已回答
add a number to the legend
Continuing with Sara's comment: In your callback function, N_pushes = N_pushes + 1; my_str = sprintf('Sandwich pan...

10 years 前 | 1

已回答
MCR dll 7.16 32-bit 64-bit Windows 7
http://www.mathworks.es/products/compiler/mcr/

10 years 前 | 1

已回答
how to get the value from the variable?
It's the symbol for a sparse matrix.

10 years 前 | 1

| 已接受

已回答
calculating velocity and acceleration from force data
Look at the dimensions of your variables: a = I/mass; -> Newtons / kg = m/s^2 -> OK %velocity v ...

10 years 前 | 0

| 已接受

已回答
how to plot conditional statement like when Vin=1, Vout=exp(-t/tn) and for Vin =0, Vout=1-exp(-t/tp) where Vin is a periodic square pulse.
statement like when Vin=1, Vout=exp(-t/tn) and for Vin =0, Vout=1-exp(-t/tp): if (Vin == 1) Vout=exp(-t/tn); else...

10 years 前 | 0

已回答
MATLAB - Need help storing values of previous iterations in a while loop
I think your while loop should go like this: while (abs(V) >= vtol) && (abs(a) >= atol) F1=-ks(1)*(X-rs(1)); ...

10 years 前 | 1

| 已接受

已回答
ksdensity function for pdf estimation
As you can see in the _ksdensity_ documentation, depending n how you use the function, there is nothing abnormal with your resul...

10 years 前 | 0

加载更多