Réponse apportée
help deleting rows with column value in a table of data
Suppose your table data stored in the variable T T(find(T.ARRAY == 2),:) = [];

environ 6 ans il y a | 0

Réponse apportée
how to Specify Time Zones?
Given mat file contains series date numbers. Instead of taking time zone as '+HH:mm' format specify local area string as 'Asia/K...

environ 6 ans il y a | 0

Réponse apportée
Use generic matrix an input into a function in MATLAB
function output = iszero(Z) output = any(diag(Z) == 0); end

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to find minimum values of all lines on matrix?
B = min(A, [], 2);

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Add a vector to a matrix if satisfies one condition
col_3 = A(:, 3); % 3rd column of A con = col_3(2)- 1> B(end) >col_3(end)+1; % your condition if cond C = [A;B]; ...

environ 6 ans il y a | 0

Réponse apportée
Trying to make every odd number zero in a vector
x(find(mod(x, 2))) = 0; or x(1:2:end) = 0;

environ 6 ans il y a | 0

Réponse apportée
Storing values in a loop
Already your 20000 iterations of the x is stored in the variable in x and for the histogram use command as hist(x)

environ 6 ans il y a | 0

Réponse apportée
while loop multiple conditions
eps=ones(1,n_windings)*0.01; T_WATERback=ones(1,n_windings)*T_water_hp; T_WATERfront=T_WATER; T_WIREback=ones(1,n_windings)*(...

environ 6 ans il y a | 0

Réponse apportée
Could anyone help me how to rearrange the matrix in the descending order with respect to the values in another matrix.
[~, b] = sort(c, 'descend');

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to turn existing code into app and which components to use?
You can use any action UI control button in app designer, suppose mostly used one is push button. In the respective UI control ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
how will I replace a string with another string without using strrep?
Can I use regexprep command ??, If yes function newstring = replace_tags(readstring,tag,replacement) r_s=lower(readstring)...

environ 6 ans il y a | 0

Réponse apportée
add matrix to cell
I guese you want like this?? A=rand(25,25); B=fliplr(A(2:25,:)); % only line no 2 C= nan(25,25); C(2:25, :) = B; % assign...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to plot for for a range? showing error
Your code t = 0:0.001:1; D = (117649*exp(4*t))/6561- (117649*exp(4*t))/26244 - (117649*t.^2.*exp(4*t))/4374 - ... (117649...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Looping for storing differet matrix in different rows but in same matrix.
In simple way Calculated_Data = reshape([alpha_data{:}],6,79); In for loop Calculated_Data = zeros(6, 79); k = 1; % count...

plus de 6 ans il y a | 0

Réponse apportée
Easier ways to write this scipt.
clear; clc; balance = 1000;%initial deposit deposit = 500; %yearly deposit APR = 0.04; %interest rate % years =[0:14]; %yea...

plus de 6 ans il y a | 0

Réponse apportée
my Plot not showing a line only the points
If you need plot as line in anyway take additional variables to plot it % Numerical Method of Solving ODE \ Euler Method% % '...

plus de 6 ans il y a | 1

Réponse apportée
Vectorization of a for loop
% assuming fake data filteredArray = [8 3 5 6 10 5 10 4 8 7]; inputScalar = 5; % then appl...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Importing three .txt files into a structure and then do calculations and form graph.
You said text file contains 31 columns but it has 19 columns only(attached file) You are able to get data for 19 colums from yo...

plus de 6 ans il y a | 0

Réponse apportée
How to pick a corresponding value during a for loop run
It is possible, only if both variable scores and 0:Dtetha:Dmax(direction) lengths are equal function D_auto = response(x) % ...

plus de 6 ans il y a | 0

| A accepté

A résolu


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

plus de 6 ans il y a

Réponse apportée
Create a string array (MxN) where each element is a repeated character based off a numeric array (MxN)
B = string(cellfun(@(x)repelem('#', x), num2cell(A), 'UniformOutput', false));

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Cartesian to polar matrix
Ybus = [ 20-j*50 -10+j*20 -10+j*30 -10+j*20 26-j*52 -16+j*32 -10+j*30 -16+j*32 26-j*62]; [angle_Ybus, rh...

plus de 6 ans il y a | 0

Réponse apportée
How can i get matrix element for a complex values?
% suppose a fake matrix with size 3x3 >> A = rand(3); A = 0.7922 0.0357 0.6787 0.9595 0.8491 0.7577 ...

plus de 6 ans il y a | 0

Réponse apportée
Random string generation of message
Assuming you are dealing with row string function out_str = rand_string_gen(np, str) % np = numberf of positions % str = inpu...

plus de 6 ans il y a | 0

Réponse apportée
Cartesian to polar matrix
If Ybus = [x + iy] then [angle_Ybus, rho_Ybus] = cart2pol(real(Ybus), imag(Ybus)); see the more details in https://in.mathwor...

plus de 6 ans il y a | 0

Réponse apportée
How do I fill empty Matrix elements with NaNs?
% assuming a fake structure similor to your case A.a = rand(4,1); A.b = []; A.c = rand(7,1); A.d = rand(10,1); fields = f...

plus de 6 ans il y a | 0

| A accepté

A résolu


Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

plus de 6 ans il y a

A résolu


Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

plus de 6 ans il y a

A résolu


Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

plus de 6 ans il y a

A résolu


Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

plus de 6 ans il y a

Charger plus