Risposto
How to write a LOOP for this case?
I think this is the continuation of this question. So, once you create struture as mentioned in the above answer, you can use:...

circa 5 anni fa | 1

Risposto
How to exclude some additional points from plot legend?
You can assign plot to different variables and when you use legend only use handles of the assigned variables. For e.g. figure(...

circa 5 anni fa | 0

Risposto
How to summarize this code?
You can try to create structure for the data of different years: for i = 1:length(precips) precip.(['y',num2str(i+1981)]) ...

circa 5 anni fa | 0

| accettato

Risposto
Can you use replace to remove all characters that aren't letters from a string?
Try str = 'I; love123 you-+'; str_new = regexprep(str,'[^a-zA-Z\s]','');

circa 5 anni fa | 2

Risposto
Need help with an if loop
First, exp(x) has an expansion as follows: Now, how to define infinity? When , . So, we check if ...

circa 5 anni fa | 0

Risposto
Replace specific line in a text file
One of the way could be: fid = fopen('data.dat','r'); % Open File to read replaceline = 'act= 1,0,8,-2'; % Line to...

circa 5 anni fa | 1

| accettato

Risposto
compare between element of matrix in different size
To check if there is any common element between 2 vectors, you may consider using 'intersect()'. So, your if condition becomes: ...

circa 5 anni fa | 0

Risposto
problem in 3d figure plotting
one of the several ways could be: fill3(X,Y,Z,'b') I hope it helps !

circa 5 anni fa | 0

| accettato

Risposto
Plotting 3D Intersection
I am not sure how you actually want to plot these values. But one of the way I could think of plotting this data is by using B3:...

circa 5 anni fa | 0

| accettato

Risposto
how to over come vector mismatch error in plot
You can try : tp=2.2676*10^-3; Ts=22.6757*10^-6; n=0:Ts:100; fp=(1/tp); w=2*pi*fp; p=sin(w*n*Ts); p(find(p<0))=0; data =...

circa 5 anni fa | 0

Risposto
how do i print the 10 figures seprately ?
Try: clear;clc M = rand(1000,10); M = cos(2*pi*M); for c = 1:size(M,2) figure(c) hist(M(:,c)) title(num2str(...

circa 5 anni fa | 0

Risposto
How do you graph a function that refers to the function in its value?
MATLAB doesn't allow 0 as an index. Infact, index must be a natural number. y(0) % is an invalid index because 0 y(0.5) % is ...

circa 5 anni fa | 0

Risposto
How to turn scatterplot labels on and off using uicontrol
Try the following method (it might work for you but there are some limitations) : x = rand(1,100); y = rand(1,100); pointsize =...

circa 5 anni fa | 0

Risposto
Why is matlab giving me a a very small number when the answer should be EXACTLY zero?
It must be something to do with the limitation of matrix multiplication and the computing error comes with the this type of mult...

circa 5 anni fa | 2

Risposto
Create a new array on the basis of another array
Try: A = 100-V; A(A == max(A)) = 100;

circa 5 anni fa | 0

| accettato

Risposto
how to delete cell rows ?
One of the way to do: cell_sizes = cellfun(@size,QDSCD,'UniformOutput',false); cell_sizes = vertcat(cell_sizes{:}); ind = fi...

circa 5 anni fa | 0

| accettato

Risposto
wirte in excel sheet.
So, in order to change row as you change the q, you have to change the range dynamically. row_num = 1; % you can change that u...

circa 5 anni fa | 0

Risposto
Changing the For LOOP conditions
One of the way to do this is define the for loop conditions using predefined vectors. You can write vector to set how the for l...

circa 5 anni fa | 0

| accettato

Risposto
How to enter subscripts in matlab? for a loop
Simply shift your indeces by 1 i.e. x0 becomes x1, x1 becomes x2 and so on. N = 500; x = zeros(N+1,1); x0 = 1; x(0+1) = x0;...

circa 5 anni fa | 0

Risposto
Array indices must be positive integers or logical values.
y(0) = 1; % y(i) = k; i must be a natural number Not allowed in MATLAB. Instead write y(1) = 1;

circa 5 anni fa | 0

| accettato

Risposto
Why does my function keep returning zero?
Replace K1 = A1*exp(-(E1/R*T)); by K1 = A1*exp(-(E1/(R*T))); ans subsequently for K2 & K3 too.

circa 5 anni fa | 0

| accettato

Risposto
How to find acceleration from velocity and time data ?
Assuming you have exported velocity data from the csv file using xlsread or something and saved it in a variable, say, 'vel'. To...

circa 5 anni fa | 2

Risposto
How can I write data to excel without overwrite data that already in the excel ?
To write in the empty rows, you have to specify that to xlswrite. So, either you know the row number beforehand and use that 'xl...

circa 5 anni fa | 1

| accettato

Risposto
What's wrong with my for loop?
You don't need final 2 lines inside the 'for' loop to update 't'. t is automatically updated because of 'for' loop statement. ...

circa 5 anni fa | 0

Risposto
Find empty cells in 3D cell?
Try this: [r,c] = find(cellfun(@isempty,channelResp)); [nR,nC,nD] = size(channelResp); Dep = floor(c/nC-0.0001)+1; Col = c -...

circa 5 anni fa | 0

| accettato

Risposto
How to do function shift in MATLAB?
Try: function [ func_up ] = FuncShift( func, shift ) func_up = @(x)(func(x)+shift); end

circa 5 anni fa | 1

Risposto
\graphing witth multiple functions
Try : a = gca; hold on plot(a.XLim,[560, 560],'m--') % plots horizontal line at y = 560 To find the intersection point at y ...

circa 5 anni fa | 0

| accettato

Risposto
How to find the nth is the higher than and closest to 0.3
One of the several ways: A=[5 56 6.1 0.29 0.32 15 ]; [vec,ind] = sort(A); id = find(vec>0.3,1); rqd_value = vec(id) % Requi...

circa 5 anni fa | 0

Risposto
Plotting multiple 3D plots on one graph
Try : figure (4) grid on hold on % Hold position should be at the start of plotting to overlap plots plot3(cm_willans,pma_14...

circa 5 anni fa | 0

| accettato

Risposto
Specifying the colour of a scatter plot
Try: scatter (x, y, 'filled', 'MarkerEdgeColor',[255, 66, 0]/255, 'MarkerFaceColor',[255, 66, 0]/255); to change tick labels f...

circa 5 anni fa | 0

| accettato

Carica altro