Réponse apportée
Trying to do an if/and statement on a vector but have an addition apply to only one element of vector
direction = [350; 8; 355; 1; 359]; direction0 = direction ; direction(direction<10)=direction(direction<10)+360

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Unable to perform assignment because the left and right sides have a different number of elements.
Repalce YY(t+1) = y; UU(t+1) = u; with YY(t+1,:) = y; UU(t+1,:) = u;

plus de 2 ans il y a | 0

Réponse apportée
Arrays have incompatible sizes for this operation.
sys.B is of size 2x4 and u is of size 3x1....how you can multiply them?

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
gradient arrows plot in matlab
a=0.819*10^(-3); b=2.73*10^(-3); Vo=15; rho=linspace(a,b,100); %Updated t t=linspace(0,2*pi,360); [rr,tt]=meshgrid(rho,t);...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to extract odd numbered elements.
A = 1:10 ; % Pick only odd elements idx = mod(A,2)~=0 ; A(idx)

plus de 2 ans il y a | 0

Réponse apportée
How to find every principal submatrix of a matrix. (given input row and column indices)
You can delete 1, 3 rd row and column from 5x5 matrix using: A = rand(5) ; A([1 3],:) = [] ; % delete 1st and 3rd row A(:...

plus de 2 ans il y a | 0

Réponse apportée
I want to draw a mesh surface. But when I use that code to draw it, YZ line is disappeared...
x=[1 2 3]; y=[1 2 3 4]; [X,Y]=meshgrid(x,y); Z=Y; surf(X,Y,Z)

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Index in position 1 exceeds array bounds (must not exceed 1).
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1388229/radd.csv') ; dB = T.(3) ; % pol_1 = 10*lo...

plus de 2 ans il y a | 0

Réponse apportée
Problem with variable 'nanmean'.
Use mean mean(data,'omitnan')

plus de 2 ans il y a | 0

Réponse apportée
Solving equation using 'vpa' function
syms x; eqn = sin(x - 1.1556)+(sin(1.1556)*exp(-x/2.2683))==0; solve(eqn,x) vpasolve(eqn,x)

plus de 2 ans il y a | 0

Réponse apportée
How to plot a mashgrid within an ir-regular shape?
clc; clear ; x=72.68:0.005:72.97; y=34:0.005:34.7; n = length(x ) ; m = length(y ) ; [X,Y] = meshgrid(x,y ) ; data=readm...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
non uniform data using imagesc is wrong
How about h = pcolor(0:step_number, 3e8./frequencies, 10*log10(Spectra)); ; >> h.EdgeColor = 'none';

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
how to display all of the 'nc' files ? I have total number of 52 files, and when i am run the code, it gives the output as '0*1 struct ' ? The code is given beolw
thepath = '' % give you path here ncfiles = dir([thepath,'\*.nc']) ; N = length(ncfiles) ; % total files for i = 1:N ...

plus de 2 ans il y a | 0

Réponse apportée
I want to calculate the mean of the soil moisture satellite data ,i have daily based data of one year with size 1440*720,and how to calculate the mean? I am confused to find
sm_mean = nanmean(data,'all') Demo A = rand(3,3,3) ; for i = 1:3 mean(A(:,:,i),'all') end

plus de 2 ans il y a | 1

Réponse apportée
How to correct figure size for plots?
set(gcf, 'color','w','Position',[680, 250,1600,846]); % change the dimenions of figure here t1 = tiledlayout(4,2,'TileSpacing...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
solve the equation for one variable and find the value of variable
syms a P = [1.0 1.2 2.2 3.4 4.4 6.7 4.2 4.8 6.4 7.4] ; s = zeros(size(P)) ; for i = 1:length(P) p = P(i) ; ...

plus de 2 ans il y a | 0

Réponse apportée
how to convert the satellite data to an image
Read about imwrite.

plus de 2 ans il y a | 0

Réponse apportée
Can anyone provide me simple code for T-Tide assessment. I want to use T-Tide assessment and prediction. I am new to MATLAB but have basic knowledge. I have tidal data.
This is the home-page for t_Tide: https://www.eoas.ubc.ca/~rich/ You have a look on the function t_demo. This gives an easy ex...

plus de 2 ans il y a | 0

Réponse apportée
i want plot 100 sheets of excel data in one plot. in each sheet number of column's are same and i want to plot 3rd column on Y axis and the cycle(sheet number) on y-axis.
file = 'filename.xlsx' ; [status,sheets] = xlsfinfo(file) ; N = length(sheets) ; figure hold on for i = 1:N fprin...

presque 3 ans il y a | 0

Réponse apportée
Colormap with different color transition
USe RGB color values. For this use the link: https://www.rapidtables.com/web/color/RGB_Color.html Fix two colrs, initial color...

presque 3 ans il y a | 0

Réponse apportée
find the maximum value in within a specific range?
A = [50.36 2 50.94 500 51.45 40 51.86 253 51.93 290 52.16 960 52.39 15]; ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How do I fix the error invalid use of operator?
You should change this line: C = CAO*(1-x)@(x)1./(1-x); to C = @(x) CAO*(1-x).*1./(1-x);

presque 3 ans il y a | 0

Réponse apportée
How to terminate my code?
You can use for loop instead of while....You know the number of counts right. clc; close all; clear all; %-----------SPACEG...

presque 3 ans il y a | 0

Réponse apportée
Index exceeds number of array elements. Index must not exceed one. Error when applying length() outside of any loop
It looks like you have used the functions length as a variable name. The work space shows length as 296132. You should not nam...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
How to delete rows with values 0 from matrix
A = [0 0 0; 0 0 0; 5 1 0; 0 0 0; 1 0 3; 5 9 5; 0 0 0] A(~any(A,2),:) = []

presque 3 ans il y a | 0

Réponse apportée
How to input two values as one value
samples = length(Y); fs = 100; time = 0:1/fs:samples/fs-1/fs; iwant = Y(time>=20 & time<=40)) %<-- this pciks Y for time be...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
how to make a table of iterations
The vairable T at the end is the required table. If you want it as an array check the variable iwant. tic clear; clc; close a...

presque 3 ans il y a | 0

Réponse apportée
I am confused what is wrong with my code
You need to input the image move to the function. move = input('Enter the name of the image: ', 's'); [board_game1] = Analyze...

presque 3 ans il y a | 0

Réponse apportée
How can I 3d interpolate a function f: R^3 --> R^3 ?
Read about scatteredInterpolant and griddata

presque 3 ans il y a | 1

Réponse apportée
I am MATLAB beginner, and I got stuck because of some error. Not enough input arguments. Error in Function1 (line 15) R1 = imfilter(InputImg, H, 'symmetric');
It looks like you are running the code/ function striaght away using hit button or F5 or by calling the function. This is not th...

presque 3 ans il y a | 0

| A accepté

Charger plus