Risposto
roots finding using muller method
The Muller's method is supposed for finding the real solution. Your code is attempting to find the complex solution. I am wond...

circa 3 anni fa | 1

Risposto
How can I trim these strings according to the underscores
str = "Novana_Model_B180_DK1_4284.0" str1 = strsplit(str, '_') join(str1(1:4), '')

circa 3 anni fa | 0

| accettato

Risposto
Find a random position in a vector where the value is zero
% Generate some randome data with zeros n = 10; a = randn(1, n); k = randperm(n, round(n/2)); a(k) = 0; a % find zeros ...

circa 3 anni fa | 1

Risposto
I am trying to get a numerical answer of following improper integral but not getting the correct value
Your integration interval [-11/7 11/7] include two points with infinity. Try the following: syms x; f =(exp(1/cos(x))); A=vp...

circa 3 anni fa | 0

Risposto
How can perform "find" in loop?
VF = imread('Vf.tif'); Tnormal= imread('Tnormmsh.tif'); %[i,j]=size(VF); %length=i*j; len = numel(VF); % don't use length...

circa 3 anni fa | 0

| accettato

Risposto
Improving the performance of matrix multiplication and division with nested for loops
Analyse your program to see if the matrix A is independent of which loop variables (it seems A is independent to some loop varia...

circa 3 anni fa | 0

| accettato

Risposto
Button to forward and rewind Videos
This can be accomplished by "timer class" (https://www.mathworks.com/help/matlab/ref/timer-class.html). On each timer event, you...

circa 3 anni fa | 0

Risposto
I'm trying to convert a 1 dimension lat,lon,data to 2d data . Is this possible?
Updated solution: T1 = readtable('chiranjit Das DAY_1.xlsx'); dg = 1; longrid = (-180:dg:180); latgrid = (-90:dg:90); z = n...

circa 3 anni fa | 0

| accettato

Risposto
replacing a element of an array and show them in certain way.
a=[4 -6 0 2 5 0 -6] a(a>0) = 1; a

circa 3 anni fa | 0

Risposto
butter is not working
clc; clear all; close all; m=1; Am=5; Fa=2000 ta=1/Fa; t=0:ta/999:6*ta; ym=Am*sin(2*pi*Fa*t); subplot(4,1,1); plot(t...

circa 3 anni fa | 0

| accettato

Risposto
When a safe a csv file I can not see numbers instead symbols
remove the last line: save ('condition.csv', 'tabla'). You have already generate the .csv file in previous line.

circa 3 anni fa | 1

| accettato

Risposto
draw line graphs connecting two points
% Fisrt specify the coordinates pstart = [ones(1,5); (1:5)] pend = [ones(1,5)+5; (1:5)+9] % plot the lines plot([pstar...

circa 3 anni fa | 0

Risposto
pwelch info: equation involved and problem on the integral
From "doc pwelch" Welch’s Overlapped Segment Averaging Spectral Estimation The periodogram is not a consistent estimator of th...

circa 3 anni fa | 0

| accettato

Risposto
How to retrieve location values in a matrix
% Generate a 4X6 matrix a = randi(10, 4, 6) % The index to each column %idx = [ 3 4 1 5 2 2] % 5 is not correct idx ...

circa 3 anni fa | 0

| accettato

Risposto
How to create a log file of output regardless of whether program finishes running?
Consider use error catch: clear; try diary_name = strcat('_diary.txt'); diary_folder = pwd; diary(diary_name) ...

circa 3 anni fa | 0

| accettato

Risposto
what is the difference between assigning with and without range?
There should not be major performance difference between "a=b" and "a(1:N)=b". The assignment with range allow partial assignme...

circa 3 anni fa | 0

Risposto
Iterative solution for a non-linear equation
Sa = 2.7956; A = 2.24; B = 0.5547; % Change the original code to the following. Otherwise not working. f = @(ag_p) ag_p*(A+...

circa 3 anni fa | 0

Risposto
How can I visualized the multiple tables read from a for loop in the variable space?
Create a cell array of tables: for i = 1:5 filename = sprintf('variables_%d.csv',i) fileID(i) = fopen(filename,'r'); ...

circa 3 anni fa | 1

Risposto
Is there any option like zline?
If all you want is to plot x-y-z axis passing through origin, then you can do the following. (assuming that origin is somewhere...

circa 3 anni fa | 0

| accettato

Risposto
Discrepancy between eigenvalues and eigenvectors derived from analytical solution and matlab code.
First, the sign in the last element of H should be '-' rather than '+' as in your question. Second, "doc eig" command for the o...

circa 3 anni fa | 0

| accettato

Risposto
GA for single variable
Yes, you can. Howerver, no gurantee of the optimal solution (just like any other non-linear optimization approaches). a = 1; ...

circa 3 anni fa | 0

Risposto
Signal is not getting filtered properly
Try design the filters as follows. The filter will attenuate the frequency content below 500Hz. When plotting spectrum, you may...

circa 3 anni fa | 1

| accettato

Risposto
"Warning: Negative data ignored" for title(), xlabel(), ylabel()
There is no problem except for the warning: x=(-1:.1:10); semilogx(x, cos(x)) xlabel('x') ylabel('y') title('test')

circa 3 anni fa | 0

Risposto
How i fix the error "Matrix dimensions must agree?"
Which version of matlab you are using? xi=randi([10,30],4,4) A=xi(1,:) B=xi(:,1) % arrays with implicit expansion for newe...

circa 3 anni fa | 0

Risposto
Matlab says, I reached the max limit of recursion: " Maximum recursion limit of 500 reached. "
Try "clear all" before running the code. Change "Histogram2" to "histogram2" (case sensitive). It seems there is no recursive ...

circa 3 anni fa | 0

Risposto
check ismember for each element individually
Doc ismember to see if it meets your requirement: a=[ 1 2 3 3 5 6 6]; b=[1 2 3 5 6]; [Lib, Loca] = ismember(b, a) a(Loca) %...

circa 3 anni fa | 1

Risposto
How can I plot some fft data in a different way?
% Assume there are 3 spec (corresponding to phi) nf = 20; nt=15; nspec = 3; sp = randn(nf, nt, nspec); % reshape the spectr...

circa 3 anni fa | 0

Risposto
find elapse time with date rollover
tstr=[ "11:58:00" "11:59:00" "00:00:02" "00:02:04"]; t = datenum(tstr, 'HH:MM:SS') d = diff(t)*24*3600; % check for negat...

circa 3 anni fa | 0

Risposto
How can I set the format HH:MM to plot an array?
t = datetime(0,0,0,15,0,1:3500); % Y,M,D,HH,MM,SS x = randn(3500, 1); plot(t, x) datetick('x', 'HH:MM') xlim(t([1 end]))

circa 3 anni fa | 2

| accettato

Carica altro