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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to do this operation
A(1:length(A)-13) .* B

fast 9 Jahre vor | 1

| akzeptiert

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 1

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 2

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

fast 9 Jahre vor | 1

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 1

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

fast 9 Jahre vor | 2

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 1

| akzeptiert

Frage


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

fast 9 Jahre vor | 3 Antworten | 1

3

Antworten

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

fast 9 Jahre vor | 1

| akzeptiert

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

fast 9 Jahre vor | 1

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 1

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 3

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 0

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

fast 9 Jahre vor | 0

| akzeptiert

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

fast 9 Jahre vor | 4

| akzeptiert

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

fast 9 Jahre vor | 1

| akzeptiert

Mehr laden