Réponse apportée
Create a Matrix with Euclidian Distances between Coordinates
A = rand(8,2,3) ; B = permute(A,[1 3 2]); B = reshape(B,[],size(A,2),1) ; iwant = squareform(pdist(B))

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Use a command only once
Make theta_b also a input variable. % Inputs are reference voltage Vdr and Vqr,reference current ,Idr and Iqr % and measured ...

plus de 3 ans il y a | 0

Réponse apportée
How do I extract values of a matrix based upon an ID array?
REad about knnsearch x = [0 0 1 2] ; y = [0 0 1 2] ; [X,Y] = meshgrid(x,y) ; A = rand(4) ; idx = knnsearch([X(:) Y(:)],[1 ...

plus de 3 ans il y a | 0

Réponse apportée
HOW TO OPEN IMAGE AS ATTACHED
Your is is a hdr image. Read about hdfread

plus de 3 ans il y a | 0

Réponse apportée
How to plot and filter some values from a csv file?
sonar_F_030 = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1127720/sonar_F_030.csv'); x1 = sonar_F_...

plus de 3 ans il y a | 0

Réponse apportée
How to graph 3 cylinders together.
Youmay modify the belo code and achieve it. Radius = 2. ; % Radius of the cylindrical theta = 360. ; % A...

plus de 3 ans il y a | 0

Réponse apportée
not able to plot
You need to save like shown bel and then plot: clc %% DESIGN ASSIGNMENT 1 %% %%-----------given----------%% Alt = 35000...

plus de 3 ans il y a | 0

Réponse apportée
syms x >> int(OHF(x,0,0,0),x,0,2) getting error msg " Undefined function 'OHF' for input arguments of type 'sym'".
x = OHF(rand,rand,rand) function out =OHF(b,mu,eta) syms x out=x^(mu-1)*(x+b+sqrt(x^(2)+2*b*x))^(-eta); end OR x = OHF(r...

plus de 3 ans il y a | 0

Réponse apportée
change legend name of ROC
plotroc(Ts,Y) hLegend = findobj(gcf, 'Type', 'Legend'); %get text hLegend.String % Change hLegend.String {'One' 'Two' 'Thr...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
I want to change the size of a patch of .mat files from 40x40x40 to 64x64x64
Read about imresize3. I1 = imresize3(I,[64 64 64]) ; % I is your 40x40x40 image

plus de 3 ans il y a | 0

Réponse apportée
Plotting voltage vectors to head to tail
Vs = rand(1,2) ; Irc = rand(1,2) ; Vrrc = rand(1,2) ; Vcrc = rand(1,2) ; A = [Vs;Irc;Vrrc;Vcrc]; % GEt coordinates P ...

plus de 3 ans il y a | 0

Réponse apportée
Avoiding (X,Y)=(0,0) from loop
M=64; r = linspace(10^-3,1,M); theta = linspace(0,2*pi,M); [R, THETA] = meshgrid(r,theta); X = R....

plus de 3 ans il y a | 0

Réponse apportée
How to georeference in MATLAB?
file = 'truemap_automatedEditedz.tif' ; [A,R] = readgeoraster(file) ; image([-180 180], [90 -90],A)

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to add the the "change in" symbol (i.e the small tringle) on y label
Read about plot. The marker '^' goves you upper triangle and the marker 'v' gives you lower triangle.

plus de 3 ans il y a | 0

Réponse apportée
How to plot streamlines using Streamslice?
[X,Y] = meshgrid(-5:0.1:5,-5:0.1:5) ; u = X.*(1+2*Y) ; v = Y ; streamslice(X,Y,u,v)

plus de 3 ans il y a | 0

Réponse apportée
I am supposed to use a for loop to create 𝑥-values and compute 𝑓(𝑥) values for the function
f = @(x) x.^2 ; m = 100; x = linspace(0,10,m) ; y = zeros(1,m) ; for i = 1:m y(i) = f(x(i)) ; end plot(x,y)

plus de 3 ans il y a | 0

Réponse apportée
How to export a double matrix into csv
Read about csvwrite, writetable

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Index in position 1 exceeds array bounds. Error in dt (line 41) del(i,N) = del(i,N-i);
This error occurs, when you try to extxract more number of elements than present in the array. % Example A = [1 2] ; A(1) %...

plus de 3 ans il y a | 1

Réponse apportée
I'd like to extract a timeseries for a 4-D double variable from a .nc file that contains: 1)time, 2)longitude, 3)latitude, 4)depth
As your matrix is 4D....you can read the variable 'var' of your interest in the following way... data = ncread(ncfile,'var',star...

plus de 3 ans il y a | 0

Réponse apportée
how to write a geometric series in command window
a = 1 ; r = 2 ; n = 0:9 ; gp = a*r.^n

plus de 3 ans il y a | 0

Réponse apportée
Don't show "NaN" in uitable ,if there not value in a table cell.
You can remove the NaN's using isnan. A = [1 2 NaN 3 4 NaN 5] ; A(isnan(A)) = []

plus de 3 ans il y a | 0

Réponse apportée
How can I get select rows of a cell?
If all you are numbers why don't use load, importdata, readtable. Also in the textscan, you can get an array, read about cell2...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to make a m*2 matrix into n number of 2x2 matrices
A = rand(208,2) ; [r,c] = size(A); nlay = 104 ; out = permute(reshape(A',[c,r/nlay,nlay]),[2,1,3]);

plus de 3 ans il y a | 0

Réponse apportée
too many input arguments .
You should show how you are calling the function. Note that, this function takes only one input q which is a 1x2 array. It seems...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Generate dll for a c file in matlab
Read about mex

plus de 3 ans il y a | 0

Réponse apportée
Polyfit matrix from import TXT file
% Import data filename = 'A2Q2_input_a.txt'; T = readtable(filename); x = T.(1) ; y = T.(2) ; % perform linear polyfit fun...

plus de 3 ans il y a | 0

Réponse apportée
How can I get a license number?
Read about license

plus de 3 ans il y a | 0

Réponse apportée
Using for loops to determine the largest number in an array.
RandomNumbers = [3, 9, 27, 81, 7, 9, 10, 33, 2, 55]; LargestNumber = RandomNumbers(1); for i = 2:length(RandomNumbers) if Ra...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Inserting black lines on pcolor plot
You can use contour. Let X, Y, H be your data of (x,y) coordinates and H be your depth. figure hold on pcolor(X,Y,H) shad...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Get one equation from two complex roots
syms s eqn = (s-(-9+1i*3))*(s-(-9-1i*3)) ; simplify(eqn)

plus de 3 ans il y a | 0

Charger plus