답변 있음
I was given some matlab code. How do I figure out what toolboxes are necessary to run the code?
There might be better and easier ways, but I usually run the code first. If there are some undefined functions, or errors regard...

10년 초과 전 | 0

답변 있음
Find sum of max values in matrix subject to constraints
a = [0 0 3 ; 0 7 2 ; 5 0 1 ] ; b = [1 2 3 ; 1 2 100 ; 1 100 100 ] ; [first_max, ind] = max(a(:)); [m1, n1] = ind2sub(s...

10년 초과 전 | 0

| 수락됨

답변 있음
How to do this operation
A(1:length(A)-13) .* B

10년 초과 전 | 1

| 수락됨

답변 있음
plotting 100 times in same plot
t = [0 : 40]; % time samples f = 500; % input frequency fs = 8000; % sampling frequency x =...

10년 초과 전 | 0

| 수락됨

답변 있음
How can I get a prompt to repeat for a user given input?
Hi, Liz. I think you should use |sprintf|. states = inputdlg('How many states are you going to?'); states = str2num(stat...

10년 초과 전 | 1

답변 있음
Running a sum function using a for loop?
function[x]=sum1 (x,a,b) total=0; for k=1:length(x) if x(k) >= a & b >= x(k) total = total + x(k); end ...

10년 초과 전 | 0

| 수락됨

답변 있음
Write an if statement inside of a while loop to check for a positive, negative, or zero number entered by the user. Stop if the user enters zero.
1. prompt = 'Insert a number: '; x = input(prompt); if x < 0 fprintf('Your input is negative number %f.\n', x);...

10년 초과 전 | 2

답변 있음
how to make a geographic map from text files data
Hi, Muhammad. This is not an exact solution to your problem, but this is how you can do it. Firstly, I would create a structure...

10년 초과 전 | 1

| 수락됨

답변 있음
Can i record a figure as it is being plotted so that i can send it as an email attachment and viewed by someone who does not have matlab?
Hello. You can save an animated figure using |VideoWriter()| function. For <http://www.mathworks.com/help/matlab/ref/videowriter...

10년 초과 전 | 0

답변 있음
How can I get rid of excess "for loop"
This is how you can start. t1 = [500 1000 1500]; t2 = [500 1000 1500]; price = [3 5]; ii = 1:length(t1); % Assumed t...

10년 초과 전 | 1

답변 있음
How to filter field data in structure?
a = arrayfun(@(n) s.f2 < 30, length(s.f2)); s = s(a);

10년 초과 전 | 2

| 수락됨

답변 있음
I have converted the string 04567 to double by using str2double function.But I got the output as 4567.But I need the output as 04567 .How can it be done?
As a string, obviously you can have a leading zero. However, as you convert it to double or number, the leading numeral 0 is los...

10년 초과 전 | 0

답변 있음
Can you Help Me ? for LQR and PID
By definition, LQR gives optimal state-feedback law of the dynamic system that minimizes certain quadratic objective function. I...

10년 초과 전 | 0

답변 있음
colon operator rounding problem
Try it like this. a=(0:1200)/10; disp(a(20)); disp(a(20)-1.9); isequal(a(20),1.9) Your previous code was n...

10년 초과 전 | 1

| 수락됨

질문


Extracting near constant elements from an array
I have a vector |'data(1).IAS'| , which looks like as follows. data(1).IAS ans = 288 294 296 294 ...

10년 초과 전 | 답변 수: 3 | 1

3

답변

답변 있음
If a = 3*3 Matrix then how do I index row 1,2,3 & column 1,3 ?
A(:, [1,3])

10년 초과 전 | 1

| 수락됨

답변 있음
How can I show in a map a certain value in given its latitude and longitude?
I think the following is what you are asking for. A = [-3.69834356435644 40.3692049504951 55.2800325952722; -5.75910000000...

10년 초과 전 | 1

답변 있음
How to delete a row if it doesn't follow a pattern
a = [ 2 5 1; 3 6 2; 3 4 1; 9 4 2; 8 3 1; 3 2 2; 9 5 2; 4 8 1]; % First lets remove 2's in a row ii = 1:2:length(a); b = ...

10년 초과 전 | 0

답변 있음
Matrix X.^23 without approximation
What do you mean by without approximation? Are you talking about scientific notations? If so, you can change the format using, ...

10년 초과 전 | 0

답변 있음
@ Filtering accelerometer Data
<http://www.mathworks.com/help/dsp/examples/designing-low-pass-fir-filters.html Here> is an example of designing a low pass FIR ...

10년 초과 전 | 0

답변 있음
Matlab find an element in matrix
It means your matrix |'x'| does *not* have an element that is equal to |q^2|.

10년 초과 전 | 1

답변 있음
Calculate difference from a time series
Hi. Clumsy code but should do the trick. Used vectorized code to avoid loops. % I am assuming your dataset is a matrix A...

10년 초과 전 | 0

| 수락됨

답변 있음
how to write data from a loop to excel file
Io=0.86; Iv=0.43; theta = 0:6:360; % Better use vectorization Imax = Io+Iv+2*cos(theta) * sqrt(Io.*Iv); Imin =...

10년 초과 전 | 0

답변 있음
How can I fill with color a odd flower in a cartesian o polar coordinates?
As a matter of fact, you are filling with color. What you are filling are the small polygons as shown in the figure below. <<...

10년 초과 전 | 3

| 수락됨

답변 있음
how can I make a colored 2D-surface in a polar plot? I want to give some labels to this polar... It is possible?
clc c=input('How many blades are there in the blower?:'); t = 0:.01:2*pi; if mod(c,2)==1 radius = co...

10년 초과 전 | 0

답변 있음
How to figure out if an array is ordinary or cell?
tf = iscell(A); if tf == 1 A =cell2mat(A) end

10년 초과 전 | 0

| 수락됨

답변 있음
Nested FOR Loop Help
I don't really understand your code. What is the purpose of the first loop? I think every time it loops ( |i = 1 : numel(nCol...

10년 초과 전 | 0

답변 있음
Decimal Degrees to metres
Hi. There are |mercator.m| files available on the <http://www.mathworks.com/matlabcentral/fileexchange/ File Exchange>. Gene...

10년 초과 전 | 0

| 수락됨

답변 있음
Is it not possible to set axis globally?
Do you mean by setting the setting axis globally, the figure will have fixed properties for all functions? If so: set(0,...

10년 초과 전 | 4

| 수락됨

답변 있음
Plot, marker, setting appearance
This question has been asked many times. <http://www.mathworks.com/matlabcentral/answers/57319-controlling-the-spacing-between-m...

10년 초과 전 | 1

| 수락됨

더 보기